diff options
author | Jon Mason <mason@myri.com> | 2011-06-27 06:56:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-29 09:02:05 -0400 |
commit | b3b6ae2c2ac39efbd95b012bb5396edf9c87ecc6 (patch) | |
tree | d97214a393dc3e630ee8a94078670c663eeb5543 /drivers/net/myri10ge | |
parent | effd1edab9fd3dc03cb87097a9da2552b940456b (diff) |
myri10ge: misc style cleanups
Miscellaneous white space, style, and other cleanups
v2 includes corrections from Joe Perches
Signed-off-by: Jon Mason <mason@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/myri10ge')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 42ea4f809171..fde62100c97c 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -1086,6 +1086,9 @@ static int myri10ge_toggle_relaxed(struct pci_dev *pdev, int on) | |||
1086 | return 0; | 1086 | return 0; |
1087 | 1087 | ||
1088 | err = pci_read_config_word(pdev, cap + PCI_EXP_DEVCTL, &ctl); | 1088 | err = pci_read_config_word(pdev, cap + PCI_EXP_DEVCTL, &ctl); |
1089 | if (err) | ||
1090 | return 0; | ||
1091 | |||
1089 | ret = (ctl & PCI_EXP_DEVCTL_RELAX_EN) >> 4; | 1092 | ret = (ctl & PCI_EXP_DEVCTL_RELAX_EN) >> 4; |
1090 | if (ret != on) { | 1093 | if (ret != on) { |
1091 | ctl &= ~PCI_EXP_DEVCTL_RELAX_EN; | 1094 | ctl &= ~PCI_EXP_DEVCTL_RELAX_EN; |
@@ -1140,20 +1143,19 @@ static void myri10ge_setup_dca(struct myri10ge_priv *mgp) | |||
1140 | mgp->ss[i].cpu = -1; | 1143 | mgp->ss[i].cpu = -1; |
1141 | mgp->ss[i].cached_dca_tag = -1; | 1144 | mgp->ss[i].cached_dca_tag = -1; |
1142 | myri10ge_update_dca(&mgp->ss[i]); | 1145 | myri10ge_update_dca(&mgp->ss[i]); |
1143 | } | 1146 | } |
1144 | } | 1147 | } |
1145 | 1148 | ||
1146 | static void myri10ge_teardown_dca(struct myri10ge_priv *mgp) | 1149 | static void myri10ge_teardown_dca(struct myri10ge_priv *mgp) |
1147 | { | 1150 | { |
1148 | struct pci_dev *pdev = mgp->pdev; | 1151 | struct pci_dev *pdev = mgp->pdev; |
1149 | int err; | ||
1150 | 1152 | ||
1151 | if (!mgp->dca_enabled) | 1153 | if (!mgp->dca_enabled) |
1152 | return; | 1154 | return; |
1153 | mgp->dca_enabled = 0; | 1155 | mgp->dca_enabled = 0; |
1154 | if (mgp->relaxed_order) | 1156 | if (mgp->relaxed_order) |
1155 | myri10ge_toggle_relaxed(pdev, 1); | 1157 | myri10ge_toggle_relaxed(pdev, 1); |
1156 | err = dca_remove_requester(&pdev->dev); | 1158 | dca_remove_requester(&pdev->dev); |
1157 | } | 1159 | } |
1158 | 1160 | ||
1159 | static int myri10ge_notify_dca_device(struct device *dev, void *data) | 1161 | static int myri10ge_notify_dca_device(struct device *dev, void *data) |
@@ -1314,7 +1316,7 @@ myri10ge_unmap_rx_page(struct pci_dev *pdev, | |||
1314 | 1316 | ||
1315 | static inline int | 1317 | static inline int |
1316 | myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum, | 1318 | myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum, |
1317 | int lro_enabled) | 1319 | bool lro_enabled) |
1318 | { | 1320 | { |
1319 | struct myri10ge_priv *mgp = ss->mgp; | 1321 | struct myri10ge_priv *mgp = ss->mgp; |
1320 | struct sk_buff *skb; | 1322 | struct sk_buff *skb; |
@@ -1474,11 +1476,9 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget) | |||
1474 | { | 1476 | { |
1475 | struct myri10ge_rx_done *rx_done = &ss->rx_done; | 1477 | struct myri10ge_rx_done *rx_done = &ss->rx_done; |
1476 | struct myri10ge_priv *mgp = ss->mgp; | 1478 | struct myri10ge_priv *mgp = ss->mgp; |
1477 | |||
1478 | unsigned long rx_bytes = 0; | 1479 | unsigned long rx_bytes = 0; |
1479 | unsigned long rx_packets = 0; | 1480 | unsigned long rx_packets = 0; |
1480 | unsigned long rx_ok; | 1481 | unsigned long rx_ok; |
1481 | |||
1482 | int idx = rx_done->idx; | 1482 | int idx = rx_done->idx; |
1483 | int cnt = rx_done->cnt; | 1483 | int cnt = rx_done->cnt; |
1484 | int work_done = 0; | 1484 | int work_done = 0; |
@@ -1531,16 +1531,14 @@ static inline void myri10ge_check_statblock(struct myri10ge_priv *mgp) | |||
1531 | mgp->link_state = link_up; | 1531 | mgp->link_state = link_up; |
1532 | 1532 | ||
1533 | if (mgp->link_state == MXGEFW_LINK_UP) { | 1533 | if (mgp->link_state == MXGEFW_LINK_UP) { |
1534 | if (netif_msg_link(mgp)) | 1534 | netif_info(mgp, link, mgp->dev, "link up\n"); |
1535 | netdev_info(mgp->dev, "link up\n"); | ||
1536 | netif_carrier_on(mgp->dev); | 1535 | netif_carrier_on(mgp->dev); |
1537 | mgp->link_changes++; | 1536 | mgp->link_changes++; |
1538 | } else { | 1537 | } else { |
1539 | if (netif_msg_link(mgp)) | 1538 | netif_info(mgp, link, mgp->dev, "link %s\n", |
1540 | netdev_info(mgp->dev, "link %s\n", | 1539 | (link_up == MXGEFW_LINK_MYRINET ? |
1541 | link_up == MXGEFW_LINK_MYRINET ? | ||
1542 | "mismatch (Myrinet detected)" : | 1540 | "mismatch (Myrinet detected)" : |
1543 | "down"); | 1541 | "down")); |
1544 | netif_carrier_off(mgp->dev); | 1542 | netif_carrier_off(mgp->dev); |
1545 | mgp->link_changes++; | 1543 | mgp->link_changes++; |
1546 | } | 1544 | } |
@@ -1621,7 +1619,7 @@ static irqreturn_t myri10ge_intr(int irq, void *arg) | |||
1621 | if (send_done_count != tx->pkt_done) | 1619 | if (send_done_count != tx->pkt_done) |
1622 | myri10ge_tx_done(ss, (int)send_done_count); | 1620 | myri10ge_tx_done(ss, (int)send_done_count); |
1623 | if (unlikely(i > myri10ge_max_irq_loops)) { | 1621 | if (unlikely(i > myri10ge_max_irq_loops)) { |
1624 | netdev_err(mgp->dev, "irq stuck?\n"); | 1622 | netdev_warn(mgp->dev, "irq stuck?\n"); |
1625 | stats->valid = 0; | 1623 | stats->valid = 0; |
1626 | schedule_work(&mgp->watchdog_work); | 1624 | schedule_work(&mgp->watchdog_work); |
1627 | } | 1625 | } |
@@ -1785,9 +1783,8 @@ static const char myri10ge_gstrings_slice_stats[][ETH_GSTRING_LEN] = { | |||
1785 | "----------- slice ---------", | 1783 | "----------- slice ---------", |
1786 | "tx_pkt_start", "tx_pkt_done", "tx_req", "tx_done", | 1784 | "tx_pkt_start", "tx_pkt_done", "tx_req", "tx_done", |
1787 | "rx_small_cnt", "rx_big_cnt", | 1785 | "rx_small_cnt", "rx_big_cnt", |
1788 | "wake_queue", "stop_queue", "tx_linearized", "LRO aggregated", | 1786 | "wake_queue", "stop_queue", "tx_linearized", |
1789 | "LRO flushed", | 1787 | "LRO aggregated", "LRO flushed", "LRO avg aggr", "LRO no_desc", |
1790 | "LRO avg aggr", "LRO no_desc" | ||
1791 | }; | 1788 | }; |
1792 | 1789 | ||
1793 | #define MYRI10GE_NET_STATS_LEN 21 | 1790 | #define MYRI10GE_NET_STATS_LEN 21 |
@@ -3329,7 +3326,6 @@ abort: | |||
3329 | /* fall back to using the unaligned firmware */ | 3326 | /* fall back to using the unaligned firmware */ |
3330 | mgp->tx_boundary = 2048; | 3327 | mgp->tx_boundary = 2048; |
3331 | set_fw_name(mgp, myri10ge_fw_unaligned, false); | 3328 | set_fw_name(mgp, myri10ge_fw_unaligned, false); |
3332 | |||
3333 | } | 3329 | } |
3334 | 3330 | ||
3335 | static void myri10ge_select_firmware(struct myri10ge_priv *mgp) | 3331 | static void myri10ge_select_firmware(struct myri10ge_priv *mgp) |
@@ -3715,8 +3711,8 @@ static void myri10ge_free_slices(struct myri10ge_priv *mgp) | |||
3715 | dma_free_coherent(&pdev->dev, bytes, | 3711 | dma_free_coherent(&pdev->dev, bytes, |
3716 | ss->fw_stats, ss->fw_stats_bus); | 3712 | ss->fw_stats, ss->fw_stats_bus); |
3717 | ss->fw_stats = NULL; | 3713 | ss->fw_stats = NULL; |
3718 | netif_napi_del(&ss->napi); | ||
3719 | } | 3714 | } |
3715 | netif_napi_del(&ss->napi); | ||
3720 | } | 3716 | } |
3721 | kfree(mgp->ss); | 3717 | kfree(mgp->ss); |
3722 | mgp->ss = NULL; | 3718 | mgp->ss = NULL; |