提交 4fcfbec0 编写于 作者: W Wolfgang Denk

DB64360: Fix GCC 4.6 build warnings

Fix:
db64360.c: In function 'debug_led':
db64360.c:413:6: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_real_open':
mv_eth.c:424:6: warning: variable 'port_status' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_stop':
mv_eth.c:642:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_xmit':
mv_eth.c:718:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_receive':
mv_eth.c:803:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_get_stats':
mv_eth.c:902:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_update_stat':
mv_eth.c:930:24: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
mv_eth.c:929:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_print_stat':
mv_eth.c:1011: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:2068:15: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
sdram_init.c: In function 'check_dimm':
sdram_init.c:289:50: warning: variable 'trrd_clocks' set but not used [-Wunused-but-set-variable]
sdram_init.c:289:37: warning: variable 'tras_clocks' set but not used [-Wunused-but-set-variable]
sdram_init.c:289:24: warning: variable 'trcd_clocks' set but not used [-Wunused-but-set-variable]
sdram_init.c:289:8: warning: variable 'trp_clocks' set but not used [-Wunused-but-set-variable]
sdram_init.c:279:34: warning: variable 'devicesForErrCheck' set but not used [-Wunused-but-set-variable]
sdram_init.c: In function 'setup_sdram':
sdram_init.c:1256:13: warning: variable 'check' set but not used [-Wunused-but-set-variable]
sdram_init.c: In function 'initdram':
sdram_init.c:1735:25: warning: variable 'check' set but not used [-Wunused-but-set-variable]
sdram_init.c:1733:14: warning: variable 's1' set but not used [-Wunused-but-set-variable]
sdram_init.c:1733:6: warning: variable 's0' set but not used [-Wunused-but-set-variable]

Note: no attempt was make to clean up the mess coding style and
other issues in sdram_init.c
Signed-off-by: NWolfgang Denk <wd@denx.de>
上级 fc4df325
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "../include/mv_gen_reg.h" #include "../include/mv_gen_reg.h"
#include <net.h> #include <net.h>
#include <netdev.h> #include <netdev.h>
#include <linux/compiler.h>
#include "eth.h" #include "eth.h"
#include "mpsc.h" #include "mpsc.h"
...@@ -410,7 +411,7 @@ int checkboard (void) ...@@ -410,7 +411,7 @@ int checkboard (void)
void debug_led (int led, int mode) void debug_led (int led, int mode)
{ {
volatile int *addr = 0; volatile int *addr = 0;
int dummy; __maybe_unused int dummy;
if (mode == 1) { if (mode == 1) {
switch (led) { switch (led) {
......
...@@ -421,7 +421,7 @@ static int mv64360_eth_real_open (struct eth_device *dev) ...@@ -421,7 +421,7 @@ static int mv64360_eth_real_open (struct eth_device *dev)
ETH_PORT_INFO *ethernet_private; ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private; struct mv64360_eth_priv *port_private;
unsigned int port_num; unsigned int port_num;
u32 port_status, phy_reg_data; u32 phy_reg_data;
ethernet_private = (ETH_PORT_INFO *) dev->priv; ethernet_private = (ETH_PORT_INFO *) dev->priv;
/* ronen - when we update the MAC env params we only update dev->enetaddr /* ronen - when we update the MAC env params we only update dev->enetaddr
...@@ -519,7 +519,7 @@ static int mv64360_eth_real_open (struct eth_device *dev) ...@@ -519,7 +519,7 @@ static int mv64360_eth_real_open (struct eth_device *dev)
*/ */
MV_REG_WRITE (MV64360_ETH_MAXIMUM_TRANSMIT_UNIT (port_num), 0); MV_REG_WRITE (MV64360_ETH_MAXIMUM_TRANSMIT_UNIT (port_num), 0);
port_status = MV_REG_READ (MV64360_ETH_PORT_STATUS_REG (port_num)); MV_REG_READ (MV64360_ETH_PORT_STATUS_REG (port_num));
/* Check Link status on phy */ /* Check Link status on phy */
eth_port_read_smi_reg (port_num, 1, &phy_reg_data); eth_port_read_smi_reg (port_num, 1, &phy_reg_data);
...@@ -637,15 +637,6 @@ static int mv64360_eth_free_rx_rings (struct eth_device *dev) ...@@ -637,15 +637,6 @@ static int mv64360_eth_free_rx_rings (struct eth_device *dev)
int mv64360_eth_stop (struct eth_device *dev) int mv64360_eth_stop (struct eth_device *dev)
{ {
ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private;
unsigned int port_num;
ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
/* Disable all gigE address decoder */ /* Disable all gigE address decoder */
MV_REG_WRITE (MV64360_ETH_BASE_ADDR_ENABLE_REG, 0x3f); MV_REG_WRITE (MV64360_ETH_BASE_ADDR_ENABLE_REG, 0x3f);
DP (printf ("%s Ethernet stop called ... \n", __FUNCTION__)); DP (printf ("%s Ethernet stop called ... \n", __FUNCTION__));
...@@ -715,7 +706,6 @@ int mv64360_eth_xmit (struct eth_device *dev, volatile void *dataPtr, ...@@ -715,7 +706,6 @@ int mv64360_eth_xmit (struct eth_device *dev, volatile void *dataPtr,
{ {
ETH_PORT_INFO *ethernet_private; ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private; struct mv64360_eth_priv *port_private;
unsigned int port_num;
PKT_INFO pkt_info; PKT_INFO pkt_info;
ETH_FUNC_RET_STATUS status; ETH_FUNC_RET_STATUS status;
struct net_device_stats *stats; struct net_device_stats *stats;
...@@ -724,7 +714,6 @@ int mv64360_eth_xmit (struct eth_device *dev, volatile void *dataPtr, ...@@ -724,7 +714,6 @@ int mv64360_eth_xmit (struct eth_device *dev, volatile void *dataPtr,
ethernet_private = (ETH_PORT_INFO *) dev->priv; ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private = port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private; (struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
stats = port_private->stats; stats = port_private->stats;
...@@ -800,15 +789,12 @@ int mv64360_eth_receive (struct eth_device *dev) ...@@ -800,15 +789,12 @@ int mv64360_eth_receive (struct eth_device *dev)
{ {
ETH_PORT_INFO *ethernet_private; ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private; struct mv64360_eth_priv *port_private;
unsigned int port_num;
PKT_INFO pkt_info; PKT_INFO pkt_info;
struct net_device_stats *stats; struct net_device_stats *stats;
ethernet_private = (ETH_PORT_INFO *) dev->priv; ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private = port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private; (struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
stats = port_private->stats; stats = port_private->stats;
while ((eth_port_receive (ethernet_private, ETH_Q0, &pkt_info) == while ((eth_port_receive (ethernet_private, ETH_Q0, &pkt_info) ==
...@@ -899,12 +885,10 @@ static struct net_device_stats *mv64360_eth_get_stats (struct eth_device *dev) ...@@ -899,12 +885,10 @@ static struct net_device_stats *mv64360_eth_get_stats (struct eth_device *dev)
{ {
ETH_PORT_INFO *ethernet_private; ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private; struct mv64360_eth_priv *port_private;
unsigned int port_num;
ethernet_private = (ETH_PORT_INFO *) dev->priv; ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private = port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private; (struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
mv64360_eth_update_stat (dev); mv64360_eth_update_stat (dev);
...@@ -926,13 +910,10 @@ static void mv64360_eth_update_stat (struct eth_device *dev) ...@@ -926,13 +910,10 @@ static void mv64360_eth_update_stat (struct eth_device *dev)
ETH_PORT_INFO *ethernet_private; ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private; struct mv64360_eth_priv *port_private;
struct net_device_stats *stats; struct net_device_stats *stats;
unsigned int port_num;
volatile unsigned int dummy;
ethernet_private = (ETH_PORT_INFO *) dev->priv; ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private = port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private; (struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
stats = port_private->stats; stats = port_private->stats;
/* These are false updates */ /* These are false updates */
...@@ -955,12 +936,12 @@ static void mv64360_eth_update_stat (struct eth_device *dev) ...@@ -955,12 +936,12 @@ static void mv64360_eth_update_stat (struct eth_device *dev)
* But the unsigned long in PowerPC and MIPS are 32bit. So the next read * But the unsigned long in PowerPC and MIPS are 32bit. So the next read
* is just a dummy read for proper work of the GigE port * is just a dummy read for proper work of the GigE port
*/ */
dummy = eth_read_mib_counter (ethernet_private->port_num, eth_read_mib_counter (ethernet_private->port_num,
ETH_MIB_GOOD_OCTETS_RECEIVED_HIGH); ETH_MIB_GOOD_OCTETS_RECEIVED_HIGH);
stats->tx_bytes += (unsigned long) stats->tx_bytes += (unsigned long)
eth_read_mib_counter (ethernet_private->port_num, eth_read_mib_counter (ethernet_private->port_num,
ETH_MIB_GOOD_OCTETS_SENT_LOW); ETH_MIB_GOOD_OCTETS_SENT_LOW);
dummy = eth_read_mib_counter (ethernet_private->port_num, eth_read_mib_counter (ethernet_private->port_num,
ETH_MIB_GOOD_OCTETS_SENT_HIGH); ETH_MIB_GOOD_OCTETS_SENT_HIGH);
stats->rx_errors += (unsigned long) stats->rx_errors += (unsigned long)
eth_read_mib_counter (ethernet_private->port_num, eth_read_mib_counter (ethernet_private->port_num,
...@@ -1008,12 +989,10 @@ static void mv64360_eth_print_stat (struct eth_device *dev) ...@@ -1008,12 +989,10 @@ static void mv64360_eth_print_stat (struct eth_device *dev)
ETH_PORT_INFO *ethernet_private; ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private; struct mv64360_eth_priv *port_private;
struct net_device_stats *stats; struct net_device_stats *stats;
unsigned int port_num;
ethernet_private = (ETH_PORT_INFO *) dev->priv; ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private = port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private; (struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
stats = port_private->stats; stats = port_private->stats;
/* These are false updates */ /* These are false updates */
...@@ -2065,13 +2044,11 @@ static void eth_port_init_mac_tables (ETH_PORT eth_port_num) ...@@ -2065,13 +2044,11 @@ static void eth_port_init_mac_tables (ETH_PORT eth_port_num)
static void eth_clear_mib_counters (ETH_PORT eth_port_num) static void eth_clear_mib_counters (ETH_PORT eth_port_num)
{ {
int i; int i;
unsigned int dummy;
/* Perform dummy reads from MIB counters */ /* Perform dummy reads from MIB counters */
for (i = ETH_MIB_GOOD_OCTETS_RECEIVED_LOW; i < ETH_MIB_LATE_COLLISION; for (i = ETH_MIB_GOOD_OCTETS_RECEIVED_LOW; i < ETH_MIB_LATE_COLLISION;
i += 4) i += 4)
dummy = MV_REG_READ ((MV64360_ETH_MIB_COUNTERS_BASE MV_REG_READ((MV64360_ETH_MIB_COUNTERS_BASE(eth_port_num) + i));
(eth_port_num) + i));
return; return;
} }
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册