From patchwork Mon Sep 26 00:26:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 116337 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 AACD3B6F7B for ; Mon, 26 Sep 2011 10:27:13 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A9F372826B; Mon, 26 Sep 2011 02:26:53 +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 fP5CaDXBD1nb; Mon, 26 Sep 2011 02:26:53 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B3862282CC; Mon, 26 Sep 2011 02:26:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AF22628267 for ; Mon, 26 Sep 2011 02:26:17 +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 HuDCFv1yqLcY for ; Mon, 26 Sep 2011 02:26:17 +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 mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by theia.denx.de (Postfix) with ESMTPS id ACF0A28266 for ; Mon, 26 Sep 2011 02:26:15 +0200 (CEST) Received: by mail-fx0-f44.google.com with SMTP id 18so5006722fxd.3 for ; Sun, 25 Sep 2011 17:26:15 -0700 (PDT) Received: by 10.223.49.213 with SMTP id w21mr9643778faf.44.1316996775589; Sun, 25 Sep 2011 17:26:15 -0700 (PDT) Received: from mashiro.ms.mff.cuni.cz (eduroam32.ms.mff.cuni.cz. [195.113.21.32]) by mx.google.com with ESMTPS id w6sm18285342fah.0.2011.09.25.17.26.14 (version=SSLv3 cipher=OTHER); Sun, 25 Sep 2011 17:26:15 -0700 (PDT) From: Marek Vasut To: u-boot@lists.denx.de Date: Mon, 26 Sep 2011 02:26:06 +0200 Message-Id: <1316996766-14248-7-git-send-email-marek.vasut@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1316996766-14248-1-git-send-email-marek.vasut@gmail.com> References: <1316996766-14248-1-git-send-email-marek.vasut@gmail.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 7/7] GCC4.6: Squash warning in cmd_mem.c 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de cmd_mem.c: In function ‘do_mem_loop’: cmd_mem.c:474:25: warning: variable ‘junk’ set but not used [-Wunused-but-set-variable] The assigned variable can be removed because the pointers are volatile so accesses to their addresses are always generated. Signed-off-by: Marek Vasut Acked-by: Mike Frysinger Acked-by: Simon Glass --- common/cmd_mem.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 4daa1b3..e84cc4e 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++; + *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++; + *shortp++; } } for (;;) { cp = (u_char *)addr; i = length; while (i-- > 0) - junk = *cp++; + *cp++; } }