net/ibmvnic: Remove tests of member address
authorWen Yang <[email protected]>
Tue, 11 Dec 2018 04:20:46 +0000 (12:20 +0800)
committerDavid S. Miller <[email protected]>
Fri, 14 Dec 2018 21:36:38 +0000 (13:36 -0800)
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 <[email protected]>
CC: Benjamin Herrenschmidt <[email protected]>
CC: Paul Mackerras <[email protected]>
CC: Michael Ellerman <[email protected]>
CC: Thomas Falcon <[email protected]>
CC: John Allen <[email protected]>
CC: "David S. Miller" <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/ibm/ibmvnic.c

index ed50b8dee44f3a8699ca0a226d81f482cdd0f3c0..14d00985f08729af70702119143bcc4def2ee7d1 100644 (file)
@@ -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);