Re: [U-Boot] [PATCH] board/prodrive/p3mx/mv_eth.c: fix GCC 4.6 build warnings

2011-11-03 Thread Wolfgang Denk
Dear Wolfgang Denk,

In message 1319917101-14282-1-git-send-email...@denx.de you wrote:
 Fix:
 mv_eth.c: In function 'mv64460_eth_real_open':
 mv_eth.c:471:6: warning: variable 'port_status' set but not used 
 [-Wunused-but-set-variable]
 mv_eth.c: In function 'mv64460_eth_stop':
 mv_eth.c:722:15: warning: variable 'port_num' set but not used 
 [-Wunused-but-set-variable]
 mv_eth.c: In function 'mv64460_eth_xmit':
 mv_eth.c:796:15: warning: variable 'port_num' set but not used 
 [-Wunused-but-set-variable]
 mv_eth.c: In function 'mv64460_eth_receive':
 mv_eth.c:877:15: warning: variable 'port_num' set but not used 
 [-Wunused-but-set-variable]
 mv_eth.c: In function 'mv64460_eth_get_stats':
 mv_eth.c:979:15: warning: variable 'port_num' set but not used 
 [-Wunused-but-set-variable]
 mv_eth.c: In function 'mv64460_eth_update_stat':
 mv_eth.c:1006:24: warning: variable 'dummy' set but not used 
 [-Wunused-but-set-variable]
 mv_eth.c:1005:15: warning: variable 'port_num' set but not used 
 [-Wunused-but-set-variable]
 mv_eth.c: In function 'mv64460_eth_print_stat':
 mv_eth.c:1087:15: warning: variable 'port_num' set but not used 
 [-Wunused-but-set-variable]
 mv_eth.c: In function 'eth_clear_mib_counters':
 mv_eth.c:2141:15: warning: variable 'dummy' set but not used 
 [-Wunused-but-set-variable]
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 ---
  board/prodrive/p3mx/mv_eth.c |   33 ++---
  1 files changed, 6 insertions(+), 27 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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: w...@denx.de
A well-written program is its own heaven; a poorly-written program is
its own hell. -- Geoffrey James, The Tao of Programming
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board/prodrive/p3mx/mv_eth.c: fix GCC 4.6 build warnings

2011-10-29 Thread Wolfgang Denk
Fix:
mv_eth.c: In function 'mv64460_eth_real_open':
mv_eth.c:471:6: warning: variable 'port_status' set but not used 
[-Wunused-but-set-variable]
mv_eth.c: In function 'mv64460_eth_stop':
mv_eth.c:722:15: warning: variable 'port_num' set but not used 
[-Wunused-but-set-variable]
mv_eth.c: In function 'mv64460_eth_xmit':
mv_eth.c:796:15: warning: variable 'port_num' set but not used 
[-Wunused-but-set-variable]
mv_eth.c: In function 'mv64460_eth_receive':
mv_eth.c:877:15: warning: variable 'port_num' set but not used 
[-Wunused-but-set-variable]
mv_eth.c: In function 'mv64460_eth_get_stats':
mv_eth.c:979:15: warning: variable 'port_num' set but not used 
[-Wunused-but-set-variable]
mv_eth.c: In function 'mv64460_eth_update_stat':
mv_eth.c:1006:24: warning: variable 'dummy' set but not used 
[-Wunused-but-set-variable]
mv_eth.c:1005:15: warning: variable 'port_num' set but not used 
[-Wunused-but-set-variable]
mv_eth.c: In function 'mv64460_eth_print_stat':
mv_eth.c:1087:15: warning: variable 'port_num' set but not used 
[-Wunused-but-set-variable]
mv_eth.c: In function 'eth_clear_mib_counters':
mv_eth.c:2141:15: warning: variable 'dummy' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
---
 board/prodrive/p3mx/mv_eth.c |   33 ++---
 1 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/board/prodrive/p3mx/mv_eth.c b/board/prodrive/p3mx/mv_eth.c
index fac7633..15b3bfc 100644
--- a/board/prodrive/p3mx/mv_eth.c
+++ b/board/prodrive/p3mx/mv_eth.c
@@ -468,7 +468,6 @@ static int mv64460_eth_real_open (struct eth_device *dev)
ETH_PORT_INFO *ethernet_private;
struct mv64460_eth_priv *port_private;
unsigned int port_num;
-   u32 port_status;
ushort reg_short;
int speed;
int duplex;
@@ -569,7 +568,7 @@ static int mv64460_eth_real_open (struct eth_device *dev)
 */
 
MV_REG_WRITE (MV64460_ETH_MAXIMUM_TRANSMIT_UNIT (port_num), 0);
-   port_status = MV_REG_READ (MV64460_ETH_PORT_STATUS_REG (port_num));
+   MV_REG_READ (MV64460_ETH_PORT_STATUS_REG (port_num));
 
 #if defined(CONFIG_PHY_RESET)
/*
@@ -717,15 +716,6 @@ static int mv64460_eth_free_rx_rings (struct eth_device 
*dev)
 
 int mv64460_eth_stop (struct eth_device *dev)
 {
-   ETH_PORT_INFO *ethernet_private;
-   struct mv64460_eth_priv *port_private;
-   unsigned int port_num;
-
-   ethernet_private = (ETH_PORT_INFO *) dev-priv;
-   port_private =
-   (struct mv64460_eth_priv *) ethernet_private-port_private;
-   port_num = port_private-port_num;
-
/* Disable all gigE address decoder */
MV_REG_WRITE (MV64460_ETH_BASE_ADDR_ENABLE_REG, 0x3f);
DP (printf (%s Ethernet stop called ... \n, __FUNCTION__));
@@ -793,7 +783,6 @@ int mv64460_eth_xmit (struct eth_device *dev, volatile void 
*dataPtr,
 {
ETH_PORT_INFO *ethernet_private;
struct mv64460_eth_priv *port_private;
-   unsigned int port_num;
PKT_INFO pkt_info;
ETH_FUNC_RET_STATUS status;
struct net_device_stats *stats;
@@ -802,7 +791,6 @@ int mv64460_eth_xmit (struct eth_device *dev, volatile void 
*dataPtr,
ethernet_private = (ETH_PORT_INFO *) dev-priv;
port_private =
(struct mv64460_eth_priv *) ethernet_private-port_private;
-   port_num = port_private-port_num;
 
stats = port_private-stats;
 
@@ -874,13 +862,11 @@ int mv64460_eth_receive (struct eth_device *dev)
 {
ETH_PORT_INFO *ethernet_private;
struct mv64460_eth_priv *port_private;
-   unsigned int port_num;
PKT_INFO pkt_info;
struct net_device_stats *stats;
 
ethernet_private = (ETH_PORT_INFO *) dev-priv;
port_private = (struct mv64460_eth_priv *) 
ethernet_private-port_private;
-   port_num = port_private-port_num;
stats = port_private-stats;
 
while ((eth_port_receive (ethernet_private, ETH_Q0, pkt_info) == 
ETH_OK)) {
@@ -976,12 +962,10 @@ static struct net_device_stats *mv64460_eth_get_stats 
(struct eth_device *dev)
 {
ETH_PORT_INFO *ethernet_private;
struct mv64460_eth_priv *port_private;
-   unsigned int port_num;
 
ethernet_private = (ETH_PORT_INFO *) dev-priv;
port_private =
(struct mv64460_eth_priv *) ethernet_private-port_private;
-   port_num = port_private-port_num;
 
mv64460_eth_update_stat (dev);
 
@@ -1002,13 +986,10 @@ static void mv64460_eth_update_stat (struct eth_device 
*dev)
ETH_PORT_INFO *ethernet_private;
struct mv64460_eth_priv *port_private;
struct net_device_stats *stats;
-   unsigned int port_num;
-   volatile unsigned int dummy;
 
ethernet_private = (ETH_PORT_INFO *) dev-priv;
port_private =
(struct mv64460_eth_priv *) ethernet_private-port_private;
-   port_num = port_private-port_num;
stats = port_private-stats;