Commit b3b6ae2c authored by Jon Mason's avatar Jon Mason Committed by David S. Miller

myri10ge: misc style cleanups

Miscellaneous white space, style, and other cleanups

v2 includes corrections from Joe Perches
Signed-off-by: default avatarJon Mason <mason@myri.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent effd1eda
...@@ -1086,6 +1086,9 @@ static int myri10ge_toggle_relaxed(struct pci_dev *pdev, int on) ...@@ -1086,6 +1086,9 @@ static int myri10ge_toggle_relaxed(struct pci_dev *pdev, int on)
return 0; return 0;
err = pci_read_config_word(pdev, cap + PCI_EXP_DEVCTL, &ctl); err = pci_read_config_word(pdev, cap + PCI_EXP_DEVCTL, &ctl);
if (err)
return 0;
ret = (ctl & PCI_EXP_DEVCTL_RELAX_EN) >> 4; ret = (ctl & PCI_EXP_DEVCTL_RELAX_EN) >> 4;
if (ret != on) { if (ret != on) {
ctl &= ~PCI_EXP_DEVCTL_RELAX_EN; ctl &= ~PCI_EXP_DEVCTL_RELAX_EN;
...@@ -1146,14 +1149,13 @@ static void myri10ge_setup_dca(struct myri10ge_priv *mgp) ...@@ -1146,14 +1149,13 @@ static void myri10ge_setup_dca(struct myri10ge_priv *mgp)
static void myri10ge_teardown_dca(struct myri10ge_priv *mgp) static void myri10ge_teardown_dca(struct myri10ge_priv *mgp)
{ {
struct pci_dev *pdev = mgp->pdev; struct pci_dev *pdev = mgp->pdev;
int err;
if (!mgp->dca_enabled) if (!mgp->dca_enabled)
return; return;
mgp->dca_enabled = 0; mgp->dca_enabled = 0;
if (mgp->relaxed_order) if (mgp->relaxed_order)
myri10ge_toggle_relaxed(pdev, 1); myri10ge_toggle_relaxed(pdev, 1);
err = dca_remove_requester(&pdev->dev); dca_remove_requester(&pdev->dev);
} }
static int myri10ge_notify_dca_device(struct device *dev, void *data) static int myri10ge_notify_dca_device(struct device *dev, void *data)
...@@ -1314,7 +1316,7 @@ myri10ge_unmap_rx_page(struct pci_dev *pdev, ...@@ -1314,7 +1316,7 @@ myri10ge_unmap_rx_page(struct pci_dev *pdev,
static inline int static inline int
myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum, myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum,
int lro_enabled) bool lro_enabled)
{ {
struct myri10ge_priv *mgp = ss->mgp; struct myri10ge_priv *mgp = ss->mgp;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -1474,11 +1476,9 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget) ...@@ -1474,11 +1476,9 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget)
{ {
struct myri10ge_rx_done *rx_done = &ss->rx_done; struct myri10ge_rx_done *rx_done = &ss->rx_done;
struct myri10ge_priv *mgp = ss->mgp; struct myri10ge_priv *mgp = ss->mgp;
unsigned long rx_bytes = 0; unsigned long rx_bytes = 0;
unsigned long rx_packets = 0; unsigned long rx_packets = 0;
unsigned long rx_ok; unsigned long rx_ok;
int idx = rx_done->idx; int idx = rx_done->idx;
int cnt = rx_done->cnt; int cnt = rx_done->cnt;
int work_done = 0; int work_done = 0;
...@@ -1531,16 +1531,14 @@ static inline void myri10ge_check_statblock(struct myri10ge_priv *mgp) ...@@ -1531,16 +1531,14 @@ static inline void myri10ge_check_statblock(struct myri10ge_priv *mgp)
mgp->link_state = link_up; mgp->link_state = link_up;
if (mgp->link_state == MXGEFW_LINK_UP) { if (mgp->link_state == MXGEFW_LINK_UP) {
if (netif_msg_link(mgp)) netif_info(mgp, link, mgp->dev, "link up\n");
netdev_info(mgp->dev, "link up\n");
netif_carrier_on(mgp->dev); netif_carrier_on(mgp->dev);
mgp->link_changes++; mgp->link_changes++;
} else { } else {
if (netif_msg_link(mgp)) netif_info(mgp, link, mgp->dev, "link %s\n",
netdev_info(mgp->dev, "link %s\n", (link_up == MXGEFW_LINK_MYRINET ?
link_up == MXGEFW_LINK_MYRINET ?
"mismatch (Myrinet detected)" : "mismatch (Myrinet detected)" :
"down"); "down"));
netif_carrier_off(mgp->dev); netif_carrier_off(mgp->dev);
mgp->link_changes++; mgp->link_changes++;
} }
...@@ -1621,7 +1619,7 @@ static irqreturn_t myri10ge_intr(int irq, void *arg) ...@@ -1621,7 +1619,7 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
if (send_done_count != tx->pkt_done) if (send_done_count != tx->pkt_done)
myri10ge_tx_done(ss, (int)send_done_count); myri10ge_tx_done(ss, (int)send_done_count);
if (unlikely(i > myri10ge_max_irq_loops)) { if (unlikely(i > myri10ge_max_irq_loops)) {
netdev_err(mgp->dev, "irq stuck?\n"); netdev_warn(mgp->dev, "irq stuck?\n");
stats->valid = 0; stats->valid = 0;
schedule_work(&mgp->watchdog_work); schedule_work(&mgp->watchdog_work);
} }
...@@ -1785,9 +1783,8 @@ static const char myri10ge_gstrings_slice_stats[][ETH_GSTRING_LEN] = { ...@@ -1785,9 +1783,8 @@ static const char myri10ge_gstrings_slice_stats[][ETH_GSTRING_LEN] = {
"----------- slice ---------", "----------- slice ---------",
"tx_pkt_start", "tx_pkt_done", "tx_req", "tx_done", "tx_pkt_start", "tx_pkt_done", "tx_req", "tx_done",
"rx_small_cnt", "rx_big_cnt", "rx_small_cnt", "rx_big_cnt",
"wake_queue", "stop_queue", "tx_linearized", "LRO aggregated", "wake_queue", "stop_queue", "tx_linearized",
"LRO flushed", "LRO aggregated", "LRO flushed", "LRO avg aggr", "LRO no_desc",
"LRO avg aggr", "LRO no_desc"
}; };
#define MYRI10GE_NET_STATS_LEN 21 #define MYRI10GE_NET_STATS_LEN 21
...@@ -3329,7 +3326,6 @@ static void myri10ge_firmware_probe(struct myri10ge_priv *mgp) ...@@ -3329,7 +3326,6 @@ static void myri10ge_firmware_probe(struct myri10ge_priv *mgp)
/* fall back to using the unaligned firmware */ /* fall back to using the unaligned firmware */
mgp->tx_boundary = 2048; mgp->tx_boundary = 2048;
set_fw_name(mgp, myri10ge_fw_unaligned, false); set_fw_name(mgp, myri10ge_fw_unaligned, false);
} }
static void myri10ge_select_firmware(struct myri10ge_priv *mgp) static void myri10ge_select_firmware(struct myri10ge_priv *mgp)
...@@ -3715,8 +3711,8 @@ static void myri10ge_free_slices(struct myri10ge_priv *mgp) ...@@ -3715,8 +3711,8 @@ static void myri10ge_free_slices(struct myri10ge_priv *mgp)
dma_free_coherent(&pdev->dev, bytes, dma_free_coherent(&pdev->dev, bytes,
ss->fw_stats, ss->fw_stats_bus); ss->fw_stats, ss->fw_stats_bus);
ss->fw_stats = NULL; ss->fw_stats = NULL;
netif_napi_del(&ss->napi);
} }
netif_napi_del(&ss->napi);
} }
kfree(mgp->ss); kfree(mgp->ss);
mgp->ss = NULL; mgp->ss = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment