From 448a8edaa6a75ad4632e4b65c7bf4101b7d0c69d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 26 Sep 2011 02:26:06 +0200 Subject: [PATCH] GCC4.6: Squash warning in cmd_mem.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 [sw0312.kim: cherry-pick from mainline commit f3b3c3df189f to fix build warning] Signed-off-by: Seung-Woo Kim Change-Id: I20e93f08dc0e7fbc73fbfdf213781948f9737eb7 --- common/cmd_mem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/cmd_mem.c b/common/cmd_mem.c index f7a442a..369abff 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -474,7 +474,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; @@ -521,7 +521,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) { @@ -529,14 +529,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++; } } -- 2.34.1