From patchwork Sat Nov 5 01:55:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 123740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 81223B6FA5 for ; Sat, 5 Nov 2011 12:57:28 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1210B29600; Sat, 5 Nov 2011 02:57:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J8bPg3v3hopM; Sat, 5 Nov 2011 02:57:13 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 52FF9295F9; Sat, 5 Nov 2011 02:56:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BBD0929664 for ; Sat, 5 Nov 2011 02:56:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G19Q0hni0yBQ for ; Sat, 5 Nov 2011 02:56:11 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by theia.denx.de (Postfix) with ESMTP id 6887428B8E for ; Sat, 5 Nov 2011 02:56:08 +0100 (CET) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 18C9E186DEE3 for ; Sat, 5 Nov 2011 02:57:27 +0100 (CET) X-Auth-Info: 2K9kTnRSpiGRvkVtx9UgO9R3W2SdGW75HlKBs1JNMmo= Received: from diddl.denx.de (host-80-81-18-216.customer.m-online.net [80.81.18.216]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 0B1C41C0012D for ; Sat, 5 Nov 2011 02:56:07 +0100 (CET) Received: from gemini.denx.de (unknown [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id AB029C8CD264 for ; Sat, 5 Nov 2011 02:56:06 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id 8FBC21893016; Sat, 5 Nov 2011 02:56:06 +0100 (CET) From: Wolfgang Denk To: u-boot@lists.denx.de Date: Sat, 5 Nov 2011 02:55:14 +0100 Message-Id: <1320458160-23136-11-git-send-email-wd@denx.de> X-Mailer: git-send-email 1.7.6.4 In-Reply-To: <1320458160-23136-1-git-send-email-wd@denx.de> References: <1320458160-23136-1-git-send-email-wd@denx.de> Subject: [U-Boot] [PATCH 10/56] drivers/video/videomodes.c: fix GCC 4.6 build warning X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Fix: videomodes.c: In function 'video_get_params': videomodes.c:162:13: warning: variable 't' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk Acked-by: Anatolij Gustschin --- drivers/video/videomodes.c | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/video/videomodes.c b/drivers/video/videomodes.c index 6fe5811..ef9bc4c 100644 --- a/drivers/video/videomodes.c +++ b/drivers/video/videomodes.c @@ -159,15 +159,18 @@ video_search_param (char *start, char *param) int video_get_params (struct ctfb_res_modes *pPar, char *penv) { char *p, *s, *val_s; - int i = 0, t; + int i = 0; int bpp; int mode; + /* first search for the environment containing the real param string */ s = penv; - if ((p = getenv (s)) != NULL) { + + if ((p = getenv (s)) != NULL) s = p; - } - /* in case of the bootargs line, we have to start + + /* + * in case of the bootargs line, we have to start * after "video=ctfb:" */ i = video_search_param (s, "video=ctfb:"); @@ -177,19 +180,22 @@ int video_get_params (struct ctfb_res_modes *pPar, char *penv) } /* search for mode as a default value */ p = s; - t = 0; mode = 0; /* default */ + while ((i = video_get_param_len (p, ',')) != 0) { GET_OPTION ("mode:", mode) p += i; if (*p != 0) p++; /* skip ',' */ } + if (mode >= RES_MODES_COUNT) mode = 0; + *pPar = res_mode_init[mode]; /* copy default values */ bpp = 24 - ((mode % 3) * 8); p = s; /* restart */ + while ((i = video_get_param_len (p, ',')) != 0) { GET_OPTION ("x:", pPar->xres) GET_OPTION ("y:", pPar->yres)