[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181211042046.64810-1-wen.yang99@zte.com.cn>
Date: Tue, 11 Dec 2018 12:20:46 +0800
From: Wen Yang <wen.yang99@....com.cn>
To: Thomas Falcon <tlfalcon@...ux.ibm.com>,
John Allen <jallen@...ux.ibm.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>
Cc: netdev@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, cheng.shengyu@....com.cn,
Wen Yang <wen.yang99@....com.cn>,
"David S. Miller" <davem@...emloft.net>
Subject: [PATCH] net/ibmvnic: Remove tests of member address
The driver was checking for non-NULL address.
- adapter->napi[i]
This is pointless as these will be always non-NULL, since the
'dapter->napi' is allocated in init_napi().
It is safe to get rid of useless checks for addresses to fix the
coccinelle warning:
>>drivers/net/ethernet/ibm/ibmvnic.c: test of a variable/field address
Since such statements always return true, they are redundant.
Signed-off-by: Wen Yang <wen.yang99@....com.cn>
CC: Benjamin Herrenschmidt <benh@...nel.crashing.org>
CC: Paul Mackerras <paulus@...ba.org>
CC: Michael Ellerman <mpe@...erman.id.au>
CC: Thomas Falcon <tlfalcon@...ux.ibm.com>
CC: John Allen <jallen@...ux.ibm.com>
CC: "David S. Miller" <davem@...emloft.net>
CC: linuxppc-dev@...ts.ozlabs.org
CC: netdev@...r.kernel.org
CC: linux-kernel@...r.kernel.org
---
drivers/net/ethernet/ibm/ibmvnic.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index ed50b8dee44f..14d00985f087 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -773,11 +773,8 @@ static void release_napi(struct ibmvnic_adapter *adapter)
return;
for (i = 0; i < adapter->num_active_rx_napi; i++) {
- if (&adapter->napi[i]) {
- netdev_dbg(adapter->netdev,
- "Releasing napi[%d]\n", i);
- netif_napi_del(&adapter->napi[i]);
- }
+ netdev_dbg(adapter->netdev, "Releasing napi[%d]\n", i);
+ netif_napi_del(&adapter->napi[i]);
}
kfree(adapter->napi);
--
2.19.1
Powered by blists - more mailing lists