diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-10-05 20:19:47 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:55:27 -0400 |
commit | ddfce6bb43c6bf1c9956e7a65ce1b2e19a156bd2 (patch) | |
tree | 38e871422ccb6168ae84ca6e33e9374715c3df9b /drivers/net/acenic.c | |
parent | 43b7c451a03fe5f615710e26e8e2a3dd70eaa5b1 (diff) |
network drivers: sparse warning fixes
Fix some of the easy warnings in network device drivers.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/acenic.c')
-rw-r--r-- | drivers/net/acenic.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 2c2ed6dc98bc..6c192650d349 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -406,7 +406,7 @@ MODULE_DEVICE_TABLE(pci, acenic_pci_tbl); | |||
406 | #define DEF_STAT (2 * TICKS_PER_SEC) | 406 | #define DEF_STAT (2 * TICKS_PER_SEC) |
407 | 407 | ||
408 | 408 | ||
409 | static int link[ACE_MAX_MOD_PARMS]; | 409 | static int link_state[ACE_MAX_MOD_PARMS]; |
410 | static int trace[ACE_MAX_MOD_PARMS]; | 410 | static int trace[ACE_MAX_MOD_PARMS]; |
411 | static int tx_coal_tick[ACE_MAX_MOD_PARMS]; | 411 | static int tx_coal_tick[ACE_MAX_MOD_PARMS]; |
412 | static int rx_coal_tick[ACE_MAX_MOD_PARMS]; | 412 | static int rx_coal_tick[ACE_MAX_MOD_PARMS]; |
@@ -419,7 +419,7 @@ MODULE_AUTHOR("Jes Sorensen <jes@trained-monkey.org>"); | |||
419 | MODULE_LICENSE("GPL"); | 419 | MODULE_LICENSE("GPL"); |
420 | MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver"); | 420 | MODULE_DESCRIPTION("AceNIC/3C985/GA620 Gigabit Ethernet driver"); |
421 | 421 | ||
422 | module_param_array(link, int, NULL, 0); | 422 | module_param_array_named(link, link_state, int, NULL, 0); |
423 | module_param_array(trace, int, NULL, 0); | 423 | module_param_array(trace, int, NULL, 0); |
424 | module_param_array(tx_coal_tick, int, NULL, 0); | 424 | module_param_array(tx_coal_tick, int, NULL, 0); |
425 | module_param_array(max_tx_desc, int, NULL, 0); | 425 | module_param_array(max_tx_desc, int, NULL, 0); |
@@ -987,27 +987,27 @@ static int __devinit ace_init(struct net_device *dev) | |||
987 | 987 | ||
988 | mac1 = 0; | 988 | mac1 = 0; |
989 | for(i = 0; i < 4; i++) { | 989 | for(i = 0; i < 4; i++) { |
990 | int tmp; | 990 | int t; |
991 | 991 | ||
992 | mac1 = mac1 << 8; | 992 | mac1 = mac1 << 8; |
993 | tmp = read_eeprom_byte(dev, 0x8c+i); | 993 | t = read_eeprom_byte(dev, 0x8c+i); |
994 | if (tmp < 0) { | 994 | if (t < 0) { |
995 | ecode = -EIO; | 995 | ecode = -EIO; |
996 | goto init_error; | 996 | goto init_error; |
997 | } else | 997 | } else |
998 | mac1 |= (tmp & 0xff); | 998 | mac1 |= (t & 0xff); |
999 | } | 999 | } |
1000 | mac2 = 0; | 1000 | mac2 = 0; |
1001 | for(i = 4; i < 8; i++) { | 1001 | for(i = 4; i < 8; i++) { |
1002 | int tmp; | 1002 | int t; |
1003 | 1003 | ||
1004 | mac2 = mac2 << 8; | 1004 | mac2 = mac2 << 8; |
1005 | tmp = read_eeprom_byte(dev, 0x8c+i); | 1005 | t = read_eeprom_byte(dev, 0x8c+i); |
1006 | if (tmp < 0) { | 1006 | if (t < 0) { |
1007 | ecode = -EIO; | 1007 | ecode = -EIO; |
1008 | goto init_error; | 1008 | goto init_error; |
1009 | } else | 1009 | } else |
1010 | mac2 |= (tmp & 0xff); | 1010 | mac2 |= (t & 0xff); |
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | writel(mac1, ®s->MacAddrHi); | 1013 | writel(mac1, ®s->MacAddrHi); |
@@ -1305,10 +1305,10 @@ static int __devinit ace_init(struct net_device *dev) | |||
1305 | writel(TX_RING_BASE, ®s->WinBase); | 1305 | writel(TX_RING_BASE, ®s->WinBase); |
1306 | 1306 | ||
1307 | if (ACE_IS_TIGON_I(ap)) { | 1307 | if (ACE_IS_TIGON_I(ap)) { |
1308 | ap->tx_ring = (struct tx_desc *) regs->Window; | 1308 | ap->tx_ring = (__force struct tx_desc *) regs->Window; |
1309 | for (i = 0; i < (TIGON_I_TX_RING_ENTRIES | 1309 | for (i = 0; i < (TIGON_I_TX_RING_ENTRIES |
1310 | * sizeof(struct tx_desc)) / sizeof(u32); i++) | 1310 | * sizeof(struct tx_desc)) / sizeof(u32); i++) |
1311 | writel(0, (void __iomem *)ap->tx_ring + i * 4); | 1311 | writel(0, (__force void __iomem *)ap->tx_ring + i * 4); |
1312 | 1312 | ||
1313 | set_aceaddr(&info->tx_ctrl.rngptr, TX_RING_BASE); | 1313 | set_aceaddr(&info->tx_ctrl.rngptr, TX_RING_BASE); |
1314 | } else { | 1314 | } else { |
@@ -1394,8 +1394,8 @@ static int __devinit ace_init(struct net_device *dev) | |||
1394 | /* | 1394 | /* |
1395 | * Override link default parameters | 1395 | * Override link default parameters |
1396 | */ | 1396 | */ |
1397 | if ((board_idx >= 0) && link[board_idx]) { | 1397 | if ((board_idx >= 0) && link_state[board_idx]) { |
1398 | int option = link[board_idx]; | 1398 | int option = link_state[board_idx]; |
1399 | 1399 | ||
1400 | tmp = LNK_ENABLE; | 1400 | tmp = LNK_ENABLE; |
1401 | 1401 | ||
@@ -2383,8 +2383,9 @@ static int ace_close(struct net_device *dev) | |||
2383 | 2383 | ||
2384 | if (mapping) { | 2384 | if (mapping) { |
2385 | if (ACE_IS_TIGON_I(ap)) { | 2385 | if (ACE_IS_TIGON_I(ap)) { |
2386 | struct tx_desc __iomem *tx | 2386 | /* NB: TIGON_1 is special, tx_ring is in io space */ |
2387 | = (struct tx_desc __iomem *) &ap->tx_ring[i]; | 2387 | struct tx_desc __iomem *tx; |
2388 | tx = (__force struct tx_desc __iomem *) &ap->tx_ring[i]; | ||
2388 | writel(0, &tx->addr.addrhi); | 2389 | writel(0, &tx->addr.addrhi); |
2389 | writel(0, &tx->addr.addrlo); | 2390 | writel(0, &tx->addr.addrlo); |
2390 | writel(0, &tx->flagsize); | 2391 | writel(0, &tx->flagsize); |
@@ -2444,7 +2445,7 @@ ace_load_tx_bd(struct ace_private *ap, struct tx_desc *desc, u64 addr, | |||
2444 | #endif | 2445 | #endif |
2445 | 2446 | ||
2446 | if (ACE_IS_TIGON_I(ap)) { | 2447 | if (ACE_IS_TIGON_I(ap)) { |
2447 | struct tx_desc __iomem *io = (struct tx_desc __iomem *) desc; | 2448 | struct tx_desc __iomem *io = (__force struct tx_desc __iomem *) desc; |
2448 | writel(addr >> 32, &io->addr.addrhi); | 2449 | writel(addr >> 32, &io->addr.addrhi); |
2449 | writel(addr & 0xffffffff, &io->addr.addrlo); | 2450 | writel(addr & 0xffffffff, &io->addr.addrlo); |
2450 | writel(flagsize, &io->flagsize); | 2451 | writel(flagsize, &io->flagsize); |
@@ -2936,7 +2937,7 @@ static void __devinit ace_clear(struct ace_regs __iomem *regs, u32 dest, int siz | |||
2936 | * This operation requires the NIC to be halted and is performed with | 2937 | * This operation requires the NIC to be halted and is performed with |
2937 | * interrupts disabled and with the spinlock hold. | 2938 | * interrupts disabled and with the spinlock hold. |
2938 | */ | 2939 | */ |
2939 | int __devinit ace_load_firmware(struct net_device *dev) | 2940 | static int __devinit ace_load_firmware(struct net_device *dev) |
2940 | { | 2941 | { |
2941 | struct ace_private *ap = netdev_priv(dev); | 2942 | struct ace_private *ap = netdev_priv(dev); |
2942 | struct ace_regs __iomem *regs = ap->regs; | 2943 | struct ace_regs __iomem *regs = ap->regs; |