Patchwork [U-Boot,06/13] board/apollon/apollon.c: Fix GCc 4.6 build warnings.

login
register
mail settings
Submitter Wolfgang Denk
Date Dec. 9, 2011, 11:14 a.m.
Message ID <1323429272-26801-7-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/130346/
State Accepted
Headers show

Comments

Wolfgang Denk - Dec. 9, 2011, 11:14 a.m.
Fix:
apollon.c: In function 'dram_init':
apollon.c:188:29: warning: variable 'cpu' set but not used
[-Wunused-but-set-variable]
apollon.c:188:20: warning: variable 'rev' set but not used
[-Wunused-but-set-variable]
apollon.c:187:26: warning: variable 'size1' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
---
 board/apollon/apollon.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
Wolfgang Denk - Dec. 10, 2011, 10:09 p.m.
Dear Wolfgang Denk,

In message <1323429272-26801-7-git-send-email-wd@denx.de> you wrote:
> Fix:
> apollon.c: In function 'dram_init':
> apollon.c:188:29: warning: variable 'cpu' set but not used
> [-Wunused-but-set-variable]
> apollon.c:188:20: warning: variable 'rev' set but not used
> [-Wunused-but-set-variable]
> apollon.c:187:26: warning: variable 'size1' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  board/apollon/apollon.c |   18 +++++++++---------
>  1 files changed, 9 insertions(+), 9 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/apollon/apollon.c b/board/apollon/apollon.c
index 4768f58..76626f0 100644
--- a/board/apollon/apollon.c
+++ b/board/apollon/apollon.c
@@ -184,14 +184,12 @@  eth_reset_err_out:
  **********************************************/
 int dram_init(void)
 {
-	unsigned int size0 = 0, size1 = 0;
-	u32 mtype, btype, rev = 0, cpu = 0;
+	unsigned int size;
+	u32 mtype, btype;
 #define NOT_EARLY 0
 
 	btype = get_board_type();
 	mtype = get_mem_type();
-	rev = get_cpu_rev();
-	cpu = get_cpu_type();
 
 	display_board_info(btype);
 
@@ -200,14 +198,16 @@  int dram_init(void)
 		do_sdrc_init(SDRC_CS1_OSET, NOT_EARLY);
 	}
 
-	size0 = get_sdr_cs_size(SDRC_CS0_OSET);
-	size1 = get_sdr_cs_size(SDRC_CS1_OSET);
+	size = get_sdr_cs_size(SDRC_CS0_OSET);
 
 	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-	gd->bd->bi_dram[0].size = size0;
+	gd->bd->bi_dram[0].size = size;
 #if CONFIG_NR_DRAM_BANKS > 1
-	gd->bd->bi_dram[1].start = PHYS_SDRAM_1 + size0;
-	gd->bd->bi_dram[1].size = size1;
+	size = get_sdr_cs_size(SDRC_CS1_OSET);
+
+	gd->bd->bi_dram[1].start = gd->bd->bi_dram[0].start +
+				   gd->bd->bi_dram[0].size;
+	gd->bd->bi_dram[1].size = size;
 #endif
 
 	return 0;