Skip to contentSkip to conversation

ppc4cc: Fixed compilation warning in 4xx_enet.c

PATCH New Alessio Centazzo 2 participants 2 messages Jun 24, 2009 – Jun 26, 2009 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc4cc: Fixed compilation warning in 4xx_enet.c

This patch fixes a compilation warning for some Ethernet PHY-less PPC4xx platforms (440SPE based ones) and a potential compilation error for 440SP platforms (use of undefined 'ethgroup' variable). In the original code and in case of 440SPE platforms, 'ethgroup' is initialized to -1 and never modified. Later in the function, within an #ifdef statement, an 'if statement' executes code only if 'ethgroup' is set to 4, therefore it is harmless to avoid executing the 'if statement' by removing the CONFIG_440SPE from the affected #ifdefs. In case of 440SP platforms with on-board Ethernet PHY, 'ethgroup' is undefined but used (there are not such platforms in the repository yet). All other architectures are not affected by this change. This is the current warning message with a Ethernet PHY-less 440SPE platform build (there is not such platform in the repository yet):

4xx_enet.c: In function 'ppc_4xx_eth_init':
4xx_enet.c:880: warning: unused variable 'ethgroup'

Signed-off-by Alessio Centazzo acpatin at yahoo.com
---
 drivers/net/4xx_enet.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/4xx_enet.c +1 -2
index 587605d..b49121c 100644
@@ -870,7 +870,7 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
     defined(CONFIG_405EX)
     u32 opbfreq;
     sys_info_t sysinfo;
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+#if defined(CONFIG_440GX) \
     defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
     defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
     defined(CONFIG_405EX)
@@ -1119,7 +1119,6 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 
 #if defined(CONFIG_440GX) || \
     defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
-    defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
     defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
     defined(CONFIG_405EX)
 
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 ppc4cc: Fixed compilation warning in 4xx_enet.c

Hi Alessio,

Please fix the subject: s/ppc4cc/ppc4xx

More comments below.

Quoted 15 lines · On Wednesday 24 June 2009 04:45:02 Alessio Centazzo wrote:

This patch fixes a compilation warning for some Ethernet PHY-less PPC4xx platforms (440SPE based ones) and a potential compilation error for 440SP platforms (use of undefined 'ethgroup' variable). In the original code and in case of 440SPE platforms, 'ethgroup' is initialized to -1 and never modified. Later in the function, within an #ifdef statement, an 'if statement' executes code only if 'ethgroup' is set to 4, therefore it is harmless to avoid executing the 'if statement' by removing the CONFIG_440SPE from the affected #ifdefs. In case of 440SP platforms with on-board Ethernet PHY, 'ethgroup' is undefined but used (there are not such platforms in the repository yet). All other architectures are not affected by this change. This is the current warning message with a Ethernet PHY-less 440SPE platform build (there is not such platform in the repository yet):

Quoted 4 lines

4xx_enet.c: In function 'ppc_4xx_eth_init':
4xx_enet.c:880: warning: unused variable 'ethgroup'

Signed-off-by Alessio Centazzo acpatin at yahoo.com

This patch also fails while applying:

Applying: ppc4cc: Fixed compilation warning in 4xx_enet.c
error: patch failed: drivers/net/4xx_enet.c:870
error: drivers/net/4xx_enet.c: patch does not apply
Patch failed at 0001 ppc4cc: Fixed compilation warning in 4xx_enet.c

Even using plain "patch" fails. Please first test applying your patches in your local environment before sending again.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================