diff options
author | David S. Miller <davem@davemloft.net> | 2011-04-11 18:49:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-11 18:49:26 -0400 |
commit | f344c25dbab1a392ef7a7afc8ca061b3b7285423 (patch) | |
tree | 5dcf48f111cf273736240aa758e4454ec28c9fd5 /drivers/net/niu.c | |
parent | 39b9afbb4c0750742eb61b7a015e12f483e0b4a3 (diff) |
niu: Fix warnings due to -Wunused-but-set-variable
Most of these were legitimate, and once case was a real bug
(not propagating errors from ->xcvr_init() methods).
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/niu.c')
-rw-r--r-- | drivers/net/niu.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 9e6330bc0531..3fa1e9cdb4a8 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -1233,7 +1233,7 @@ static int link_status_1g_rgmii(struct niu *np, int *link_up_p) | |||
1233 | 1233 | ||
1234 | bmsr = err; | 1234 | bmsr = err; |
1235 | if (bmsr & BMSR_LSTATUS) { | 1235 | if (bmsr & BMSR_LSTATUS) { |
1236 | u16 adv, lpa, common, estat; | 1236 | u16 adv, lpa; |
1237 | 1237 | ||
1238 | err = mii_read(np, np->phy_addr, MII_ADVERTISE); | 1238 | err = mii_read(np, np->phy_addr, MII_ADVERTISE); |
1239 | if (err < 0) | 1239 | if (err < 0) |
@@ -1245,12 +1245,9 @@ static int link_status_1g_rgmii(struct niu *np, int *link_up_p) | |||
1245 | goto out; | 1245 | goto out; |
1246 | lpa = err; | 1246 | lpa = err; |
1247 | 1247 | ||
1248 | common = adv & lpa; | ||
1249 | |||
1250 | err = mii_read(np, np->phy_addr, MII_ESTATUS); | 1248 | err = mii_read(np, np->phy_addr, MII_ESTATUS); |
1251 | if (err < 0) | 1249 | if (err < 0) |
1252 | goto out; | 1250 | goto out; |
1253 | estat = err; | ||
1254 | link_up = 1; | 1251 | link_up = 1; |
1255 | current_speed = SPEED_1000; | 1252 | current_speed = SPEED_1000; |
1256 | current_duplex = DUPLEX_FULL; | 1253 | current_duplex = DUPLEX_FULL; |
@@ -1650,7 +1647,7 @@ static int xcvr_init_10g(struct niu *np) | |||
1650 | break; | 1647 | break; |
1651 | } | 1648 | } |
1652 | 1649 | ||
1653 | return 0; | 1650 | return err; |
1654 | } | 1651 | } |
1655 | 1652 | ||
1656 | static int mii_reset(struct niu *np) | 1653 | static int mii_reset(struct niu *np) |
@@ -2381,17 +2378,14 @@ static int serdes_init_10g_serdes(struct niu *np) | |||
2381 | struct niu_link_config *lp = &np->link_config; | 2378 | struct niu_link_config *lp = &np->link_config; |
2382 | unsigned long ctrl_reg, test_cfg_reg, pll_cfg, i; | 2379 | unsigned long ctrl_reg, test_cfg_reg, pll_cfg, i; |
2383 | u64 ctrl_val, test_cfg_val, sig, mask, val; | 2380 | u64 ctrl_val, test_cfg_val, sig, mask, val; |
2384 | u64 reset_val; | ||
2385 | 2381 | ||
2386 | switch (np->port) { | 2382 | switch (np->port) { |
2387 | case 0: | 2383 | case 0: |
2388 | reset_val = ENET_SERDES_RESET_0; | ||
2389 | ctrl_reg = ENET_SERDES_0_CTRL_CFG; | 2384 | ctrl_reg = ENET_SERDES_0_CTRL_CFG; |
2390 | test_cfg_reg = ENET_SERDES_0_TEST_CFG; | 2385 | test_cfg_reg = ENET_SERDES_0_TEST_CFG; |
2391 | pll_cfg = ENET_SERDES_0_PLL_CFG; | 2386 | pll_cfg = ENET_SERDES_0_PLL_CFG; |
2392 | break; | 2387 | break; |
2393 | case 1: | 2388 | case 1: |
2394 | reset_val = ENET_SERDES_RESET_1; | ||
2395 | ctrl_reg = ENET_SERDES_1_CTRL_CFG; | 2389 | ctrl_reg = ENET_SERDES_1_CTRL_CFG; |
2396 | test_cfg_reg = ENET_SERDES_1_TEST_CFG; | 2390 | test_cfg_reg = ENET_SERDES_1_TEST_CFG; |
2397 | pll_cfg = ENET_SERDES_1_PLL_CFG; | 2391 | pll_cfg = ENET_SERDES_1_PLL_CFG; |
@@ -8135,7 +8129,7 @@ static int __devinit niu_pci_vpd_scan_props(struct niu *np, | |||
8135 | netif_printk(np, probe, KERN_DEBUG, np->dev, | 8129 | netif_printk(np, probe, KERN_DEBUG, np->dev, |
8136 | "VPD_SCAN: start[%x] end[%x]\n", start, end); | 8130 | "VPD_SCAN: start[%x] end[%x]\n", start, end); |
8137 | while (start < end) { | 8131 | while (start < end) { |
8138 | int len, err, instance, type, prop_len; | 8132 | int len, err, prop_len; |
8139 | char namebuf[64]; | 8133 | char namebuf[64]; |
8140 | u8 *prop_buf; | 8134 | u8 *prop_buf; |
8141 | int max_len; | 8135 | int max_len; |
@@ -8151,8 +8145,6 @@ static int __devinit niu_pci_vpd_scan_props(struct niu *np, | |||
8151 | len = err; | 8145 | len = err; |
8152 | start += 3; | 8146 | start += 3; |
8153 | 8147 | ||
8154 | instance = niu_pci_eeprom_read(np, start); | ||
8155 | type = niu_pci_eeprom_read(np, start + 3); | ||
8156 | prop_len = niu_pci_eeprom_read(np, start + 4); | 8148 | prop_len = niu_pci_eeprom_read(np, start + 4); |
8157 | err = niu_pci_vpd_get_propname(np, start + 5, namebuf, 64); | 8149 | err = niu_pci_vpd_get_propname(np, start + 5, namebuf, 64); |
8158 | if (err < 0) | 8150 | if (err < 0) |