Commit 91dc5d25 authored by Lijun Pan's avatar Lijun Pan Committed by David S. Miller

ibmvnic: fix miscellaneous checks

Fix the following checkpatch checks:
CHECK: Macro argument 'off' may be better as '(off)' to
avoid precedence issues
CHECK: Alignment should match open parenthesis
CHECK: multiple assignments should be avoided
CHECK: Blank lines aren't necessary before a close brace '}'
CHECK: Please use a blank line after function/struct/union/enum
declarations
CHECK: Unnecessary parentheses around 'rc != H_FUNCTION'
Signed-off-by: default avatarLijun Pan <lijunp213@gmail.com>
Reviewed-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 914789ac
...@@ -115,7 +115,7 @@ struct ibmvnic_stat { ...@@ -115,7 +115,7 @@ struct ibmvnic_stat {
#define IBMVNIC_STAT_OFF(stat) (offsetof(struct ibmvnic_adapter, stats) + \ #define IBMVNIC_STAT_OFF(stat) (offsetof(struct ibmvnic_adapter, stats) + \
offsetof(struct ibmvnic_statistics, stat)) offsetof(struct ibmvnic_statistics, stat))
#define IBMVNIC_GET_STAT(a, off) (*((u64 *)(((unsigned long)(a)) + off))) #define IBMVNIC_GET_STAT(a, off) (*((u64 *)(((unsigned long)(a)) + (off))))
static const struct ibmvnic_stat ibmvnic_stats[] = { static const struct ibmvnic_stat ibmvnic_stats[] = {
{"rx_packets", IBMVNIC_STAT_OFF(rx_packets)}, {"rx_packets", IBMVNIC_STAT_OFF(rx_packets)},
...@@ -2069,14 +2069,14 @@ static int do_reset(struct ibmvnic_adapter *adapter, ...@@ -2069,14 +2069,14 @@ static int do_reset(struct ibmvnic_adapter *adapter,
rc = reset_tx_pools(adapter); rc = reset_tx_pools(adapter);
if (rc) { if (rc) {
netdev_dbg(adapter->netdev, "reset tx pools failed (%d)\n", netdev_dbg(adapter->netdev, "reset tx pools failed (%d)\n",
rc); rc);
goto out; goto out;
} }
rc = reset_rx_pools(adapter); rc = reset_rx_pools(adapter);
if (rc) { if (rc) {
netdev_dbg(adapter->netdev, "reset rx pools failed (%d)\n", netdev_dbg(adapter->netdev, "reset rx pools failed (%d)\n",
rc); rc);
goto out; goto out;
} }
} }
...@@ -2333,7 +2333,8 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, ...@@ -2333,7 +2333,8 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
if (adapter->state == VNIC_PROBING) { if (adapter->state == VNIC_PROBING) {
netdev_warn(netdev, "Adapter reset during probe\n"); netdev_warn(netdev, "Adapter reset during probe\n");
ret = adapter->init_done_rc = EAGAIN; adapter->init_done_rc = EAGAIN;
ret = EAGAIN;
goto err; goto err;
} }
...@@ -2746,7 +2747,6 @@ static int ibmvnic_set_channels(struct net_device *netdev, ...@@ -2746,7 +2747,6 @@ static int ibmvnic_set_channels(struct net_device *netdev,
channels->rx_count, channels->tx_count, channels->rx_count, channels->tx_count,
adapter->req_rx_queues, adapter->req_tx_queues); adapter->req_rx_queues, adapter->req_tx_queues);
return ret; return ret;
} }
static void ibmvnic_get_strings(struct net_device *dev, u32 stringset, u8 *data) static void ibmvnic_get_strings(struct net_device *dev, u32 stringset, u8 *data)
...@@ -2835,8 +2835,8 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev, ...@@ -2835,8 +2835,8 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev,
return; return;
for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++) for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++)
data[i] = be64_to_cpu(IBMVNIC_GET_STAT(adapter, data[i] = be64_to_cpu(IBMVNIC_GET_STAT
ibmvnic_stats[i].offset)); (adapter, ibmvnic_stats[i].offset));
for (j = 0; j < adapter->req_tx_queues; j++) { for (j = 0; j < adapter->req_tx_queues; j++) {
data[i] = adapter->tx_stats_buffers[j].packets; data[i] = adapter->tx_stats_buffers[j].packets;
...@@ -2876,6 +2876,7 @@ static int ibmvnic_set_priv_flags(struct net_device *netdev, u32 flags) ...@@ -2876,6 +2876,7 @@ static int ibmvnic_set_priv_flags(struct net_device *netdev, u32 flags)
return 0; return 0;
} }
static const struct ethtool_ops ibmvnic_ethtool_ops = { static const struct ethtool_ops ibmvnic_ethtool_ops = {
.get_drvinfo = ibmvnic_get_drvinfo, .get_drvinfo = ibmvnic_get_drvinfo,
.get_msglevel = ibmvnic_get_msglevel, .get_msglevel = ibmvnic_get_msglevel,
...@@ -3145,7 +3146,7 @@ static int enable_scrq_irq(struct ibmvnic_adapter *adapter, ...@@ -3145,7 +3146,7 @@ static int enable_scrq_irq(struct ibmvnic_adapter *adapter,
/* H_EOI would fail with rc = H_FUNCTION when running /* H_EOI would fail with rc = H_FUNCTION when running
* in XIVE mode which is expected, but not an error. * in XIVE mode which is expected, but not an error.
*/ */
if (rc && (rc != H_FUNCTION)) if (rc && rc != H_FUNCTION)
dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n", dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
val, rc); val, rc);
} }
......
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