From patchwork Fri Sep 23 16:22:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 116140 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 B056CB6F88 for ; Sat, 24 Sep 2011 02:25:19 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7161C28665; Fri, 23 Sep 2011 18:24:40 +0200 (CEST) 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 N+y2L5Anw6BW; Fri, 23 Sep 2011 18:24:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CF1FA28666; Fri, 23 Sep 2011 18:23:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 65AA62851F for ; Fri, 23 Sep 2011 18:23:09 +0200 (CEST) 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 LmIYnhSmWWsX for ; Fri, 23 Sep 2011 18:23:08 +0200 (CEST) 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 smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by theia.denx.de (Postfix) with ESMTPS id B50A928526 for ; Fri, 23 Sep 2011 18:22:58 +0200 (CEST) Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id p8NGMtKv027552; Fri, 23 Sep 2011 09:22:55 -0700 Received: from sglass.mtv.corp.google.com (sglass.mtv.corp.google.com [172.22.72.144]) by wpaz17.hot.corp.google.com with ESMTP id p8NGMq0X024854; Fri, 23 Sep 2011 09:22:54 -0700 Received: by sglass.mtv.corp.google.com (Postfix, from userid 121222) id 267B0140FE5; Fri, 23 Sep 2011 09:22:52 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Fri, 23 Sep 2011 09:22:20 -0700 Message-Id: <1316794942-24709-19-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1316794942-24709-1-git-send-email-sjg@chromium.org> References: <1316794942-24709-1-git-send-email-sjg@chromium.org> X-System-Of-Record: true Subject: [U-Boot] [RFC PATCH v2 18/20] Remove unused variable warnings in cmd_mem, cmd_nvedit 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 There are a few variables set but not used - this marks these as unused for the compiler. Signed-off-by: Simon Glass --- Changes in v2: - Try to avoid needing __attribute__((unused)) by assigning to an existing var common/cmd_mem.c | 8 ++++---- common/cmd_nvedit.c | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 4daa1b3..d6965e2 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -471,7 +471,7 @@ int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - ulong addr, length, i, junk; + ulong addr, length, i; int size; volatile uint *longp; volatile ushort *shortp; @@ -518,7 +518,7 @@ int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) longp = (uint *)addr; i = length; while (i-- > 0) - junk = *longp++; + size = *longp++; } } if (size == 2) { @@ -526,14 +526,14 @@ int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) shortp = (ushort *)addr; i = length; while (i-- > 0) - junk = *shortp++; + size = *shortp++; } } for (;;) { cp = (u_char *)addr; i = length; while (i-- > 0) - junk = *cp++; + size = *cp++; } } diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index e8b116d..101bc49 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -460,7 +460,6 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char buffer[CONFIG_SYS_CBSIZE]; char *init_val; - int len; if (argc < 2) return cmd_usage(cmdtp); @@ -468,7 +467,7 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* Set read buffer to initial value or empty sting */ init_val = getenv(argv[1]); if (init_val) - len = sprintf(buffer, "%s", init_val); + sprintf(buffer, "%s", init_val); else buffer[0] = '\0';