Patchwork [U-Boot,06/13] board/evb64260/sdram_init.c: Fix GCC 4.6 build warnings

login
register
mail settings
Submitter Wolfgang Denk
Date Nov. 9, 2011, 7:28 p.m.
Message ID <1320866946-28235-6-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/124672/
State Accepted
Commit b191c701628d3aa4677cfec5de82d0d03fa8ac09
Headers show

Comments

Wolfgang Denk - Nov. 9, 2011, 7:28 p.m.
Fix:
sdram_init.c: In function 'setup_sdram_common':
sdram_init.c:333:49: warning: variable 'ecc' set but not used
[-Wunused-but-set-variable]
sdram_init.c: In function 'setup_sdram':
sdram_init.c:410:13: warning: variable 'check' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 board/evb64260/sdram_init.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
Wolfgang Denk - Nov. 16, 2011, 8:04 p.m.
Dear Wolfgang Denk,

In message <1320866946-28235-6-git-send-email-wd@denx.de> you wrote:
> Fix:
> sdram_init.c: In function 'setup_sdram_common':
> sdram_init.c:333:49: warning: variable 'ecc' set but not used
> [-Wunused-but-set-variable]
> sdram_init.c: In function 'setup_sdram':
> sdram_init.c:410:13: warning: variable 'check' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>  board/evb64260/sdram_init.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/evb64260/sdram_init.c b/board/evb64260/sdram_init.c
index e2f0769..6f725f6 100644
--- a/board/evb64260/sdram_init.c
+++ b/board/evb64260/sdram_init.c
@@ -29,6 +29,7 @@ 
 #include <galileo/pci.h>
 #include <galileo/gt64260R.h>
 #include <net.h>
+#include <linux/compiler.h>
 
 #include "eth.h"
 #include "mpsc.h"
@@ -330,7 +331,8 @@  static int check_dimm (uchar slot, sdram_info_t * info)
 static int setup_sdram_common (sdram_info_t info[2])
 {
 	ulong tmp;
-	int tpar = 2, tras_clocks = 5, registered = 1, ecc = 2;
+	int tpar = 2, tras_clocks = 5, registered = 1;
+	__maybe_unused int ecc = 2;
 
 	if (!info[0].banks && !info[1].banks)
 		return 0;
@@ -407,8 +409,9 @@  static int setup_sdram_common (sdram_info_t info[2])
 /* sets up the GT properly with information passed in */
 static int setup_sdram (sdram_info_t * info)
 {
-	ulong tmp, check;
+	ulong tmp;
 	ulong *addr = 0;
+	__maybe_unused ulong check;
 	int i;
 
 	/* sanity checking */