Skip to contentSkip to conversation

mpc83xx: spd_sdram - fix gcc 4.6 compiler warning

PATCH New Kim Phillips 3 participants 7 messages Nov 16, 2011 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 mpc83xx: spd_sdram - fix gcc 4.6 compiler warning

Configuring for sbc8349 board...
spd_sdram.c: In function 'spd_sdram':
spd_sdram.c:152:41: warning: variable 'trfc_high' set but not used [-Wunused-but-set-variable]

---
 arch/powerpc/cpu/mpc83xx/spd_sdram.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/powerpc/cpu/mpc83xx/spd_sdram.c +1 -2
index 3855bfd..04d519a 100644
@@ -149,7 +149,7 @@ long int spd_sdram()
 	unsigned int memsize;
 	unsigned int law_size;
 	unsigned char caslat, caslat_ctrl;
-	unsigned int trfc, trfc_clk, trfc_low, trfc_high;
+	unsigned int trfc, trfc_clk, trfc_low;
 	unsigned int trcd_clk, trtp_clk;
 	unsigned char cke_min_clk;
 	unsigned char add_lat, wr_lat;
@@ -542,7 +542,6 @@ long int spd_sdram()
 	 * so preadjust it down 8 first before splitting it up.
 	 */
 	trfc_low = (trfc_clk - 8) & 0xf;
-	trfc_high = ((trfc_clk - 8) >> 4) & 0x3;
 
 	ddr->timing_cfg_1 =
 	    (((picos_to_clk(spd.trp * 250) & 0x07) << 28 ) |	/* PRETOACT */
Signature · 1 line
1.7.7.3
#1 lore raw

PATCH 2/3 mpc83xx: mpc8360emds - fix gcc 4.6 compiler warning

Configuring for MPC8360EMDS_66_HOST_33 - Board: MPC8360EMDS, Options: CLKIN_66MHZ,PCI,PCI_33M,PQ_MDS_PIB=1 mpc8360emds.c: In function 'board_eth_init':
mpc8360emds.c:178:12: warning: array subscript is above array bounds [-Warray-bounds]

---
 board/freescale/mpc8360emds/mpc8360emds.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
board/freescale/mpc8360emds/mpc8360emds.c +2 -1
index be76774..bdd1293 100644
@@ -172,10 +172,11 @@ int board_eth_init(bd_t *bd)
 	if (board_handle_erratum2()) {
 		int i;
 
-		for (i = 0; i < ARRAY_SIZE(uec_info); i++)
+		for (i = 0; i < ARRAY_SIZE(uec_info); i++) {
 			uec_info[i].enet_interface_type =
 				PHY_INTERFACE_MODE_RGMII_RXID;
 			uec_info[i].speed = SPEED_1000;
+		}
 	}
 	return uec_eth_init(bd, uec_info, ARRAY_SIZE(uec_info));
 }
Signature · 1 line
1.7.7.3
#2 lore raw

PATCH 2/3 mpc83xx: mpc8360emds - fix gcc 4.6 compiler warning

Dear Kim Phillips,

Quoted 15 lines · In message <[email protected]> you…

Configuring for MPC8360EMDS_66_HOST_33 - Board: MPC8360EMDS, Options: CLKIN_66MHZ,PCI,PCI_33M,PQ_MDS_PIB=1 mpc8360emds.c: In function 'board_eth_init':
mpc8360emds.c:178:12: warning: array subscript is above array bounds [-Warray-bounds]

---
 board/freescale/mpc8360emds/mpc8360emds.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
board/freescale/mpc8360emds/mpc8360emds.c +0 -0
index be76774..bdd1293 100644
@@ -172,10 +172,11 @@ int board_eth_init(bd_t *bd)
 	if (board_handle_erratum2()) {

board/freescale/mpc8360emds/mpc8360emds.c int board_eth_init(bd_t *bd) · line 181

Quoted 10 lines
board/freescale/mpc8360emds/mpc8360emds.c +2 -1
 		int i;
 
-		for (i = 0; i < ARRAY_SIZE(uec_info); i++)
+		for (i = 0; i < ARRAY_SIZE(uec_info); i++) {
 			uec_info[i].enet_interface_type =
 				PHY_INTERFACE_MODE_RGMII_RXID;
 			uec_info[i].speed = SPEED_1000;
+		}
 	}
 	return uec_eth_init(bd, uec_info, ARRAY_SIZE(uec_info));

Seems we caught a real error here? Great! Thanks!

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
There is a biblical analogy I'd like to draw here.   Casts are to C++
Programmers what the apple was to Eve.         - Scott Douglas Meyers
#3 lore raw

PATCH 3/3 mpc83xx: km83xx_i2c - fix gcc 4.6 compiler warning

In reply to Kim Phillips

Configuring for kmeter1 board...
km83xx_i2c.c: In function 'i2c_make_abort':
km83xx_i2c.c:44:8: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]

---
 board/keymile/km83xx/km83xx_i2c.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
board/keymile/km83xx/km83xx_i2c.c +1 -2
index be17775..8df92d8 100644
@@ -41,7 +41,6 @@ int i2c_make_abort(void)
 {
 	struct fsl_i2c *dev;
 	dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
-	uchar	dummy;
 	uchar   last;
 	int     nbr_read = 0;
 	int     i = 0;
@@ -52,7 +51,7 @@ int i2c_make_abort(void)
 	udelay(DELAY_ABORT_SEQ);
 	out_8(&dev->cr, (I2C_CR_MEN | I2C_CR_MSTA));
 	udelay(DELAY_ABORT_SEQ);
-	dummy = in_8(&dev->dr);
+	in_8(&dev->dr);
 	udelay(DELAY_ABORT_SEQ);
 	last = in_8(&dev->dr);
 	nbr_read++;
Signature · 1 line
1.7.7.3
#4 lore raw

PATCH 3/3 mpc83xx: km83xx_i2c - fix gcc 4.6 compiler warning

Hello Kim,

Quoted 8 lines · Kim Phillips

Configuring for kmeter1 board...
km83xx_i2c.c: In function 'i2c_make_abort':
km83xx_i2c.c:44:8: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]

---
 board/keymile/km83xx/km83xx_i2c.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Thanks for fixing,

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#5 lore raw

PATCH 3/3 mpc83xx: km83xx_i2c - fix gcc 4.6 compiler warning

In reply to Kim Phillips

Dear Kim Phillips,

Quoted 8 lines · In message <[email protected]> you…

Configuring for kmeter1 board...
km83xx_i2c.c: In function 'i2c_make_abort':
km83xx_i2c.c:44:8: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]

---
 board/keymile/km83xx/km83xx_i2c.c |    3 +--
 1 files changed, 1 insertions(+), 2 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
What is mind?  No matter.  What is matter?  Never mind.
                                      -- Thomas Hewitt Key, 1799-1875
#6 lore raw

PATCH 1/3 mpc83xx: spd_sdram - fix gcc 4.6 compiler warning

In reply to Kim Phillips

Dear Kim Phillips,

Quoted 8 lines · In message <[email protected]> you…

Configuring for sbc8349 board...
spd_sdram.c: In function 'spd_sdram':
spd_sdram.c:152:41: warning: variable 'trfc_high' set but not used [-Wunused-but-set-variable]

---
 arch/powerpc/cpu/mpc83xx/spd_sdram.c |    3 +--
 1 files changed, 1 insertions(+), 2 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
The one who says it cannot be done should never interrupt the one who
is doing it.