Skip to contentSkip to conversation

pip405.c: Fix GCC 4.6 build warnings

PATCH New Stefan Roese 2 participants 2 messages Nov 15, 2011 – Nov 16, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 19/19 pip405.c: Fix GCC 4.6 build warnings

Fix:
pip405.c: In function 'board_early_init_f':
pip405.c:192:16: warning: variable 'tctp_clocks' set but not used [-Wunused-but-set-variable] pip405.c:182:16: warning: variable 'dataout' set but not used [-Wunused-but-set-variable]

---
 board/mpl/pip405/pip405.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
board/mpl/pip405/pip405.c +7 -4
index 7b48c06..a1f0b65 100644
@@ -179,7 +179,6 @@ void write_4hex (unsigned long val)
 
 int board_early_init_f (void)
 {
-	unsigned char dataout[1];
 	unsigned char datain[128];
 	unsigned long sdram_size = 0;
 	SDRAM_SETUP *t = (SDRAM_SETUP *) sdram_setup_table;
@@ -189,9 +188,13 @@ int board_early_init_f (void)
 	unsigned short i;
 	unsigned char rows, cols, banks, sdram_banks, density;
 	unsigned char supported_cal, trp_clocks, trcd_clocks, tras_clocks,
-			trc_clocks, tctp_clocks;
+		trc_clocks;
 	unsigned char cal_index, cal_val, spd_version, spd_chksum;
 	unsigned char buf[8];
+#ifdef SDRAM_DEBUG
+	unsigned char tctp_clocks;
+#endif
+
 	/* set up the config port */
 	mtdcr (EBC0_CFGADDR, PB7AP);
 	mtdcr (EBC0_CFGDATA, CONFIG_PORT_AP);
@@ -210,7 +213,6 @@ int board_early_init_f (void)
 
 	/* Read Serial Presence Detect Information */
 	i2c_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-	dataout[0] = 0;
 	for (i = 0; i < 128; i++)
 		datain[i] = 127;
 	i2c_read(SPD_EEPROM_ADDRESS,0,1,datain,128);
@@ -307,12 +309,13 @@ int board_early_init_f (void)
 
 	/* trc_clocks is sum of trp_clocks + tras_clocks */
 	trc_clocks = trp_clocks + tras_clocks;
+
+#ifdef SDRAM_DEBUG
 	/* ctp = ((trp + tras) - trp - trcd) => tras - trcd */
 	tctp_clocks =
 			((NSto10PS (datain[30]) - NSto10PS (datain[29])) +
 			 (tmemclk - 1)) / tmemclk;
 
-#ifdef SDRAM_DEBUG
 	serial_puts ("c_RP: ");
 	write_hex (trp_clocks);
 	serial_puts ("\nc_RCD: ");
Signature · 1 line
1.7.7.3
#1 lore raw

PATCH 19/19 pip405.c: Fix GCC 4.6 build warnings

Dear Stefan Roese,

Quoted 9 lines · In message <[email protected]> you wrote:

Fix:
pip405.c: In function 'board_early_init_f':
pip405.c:192:16: warning: variable 'tctp_clocks' set but not used [-Wunused-but-set-variable] pip405.c:182:16: warning: variable 'dataout' set but not used [-Wunused-but-set-variable]

---
 board/mpl/pip405/pip405.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
O Staat!   Wie tief dir alle Besten fluchen!  Du bist kein Ziel.  Der
Mensch mu? weiter suchen.                     - Christian Morgenstern