Re: [PATCH -next] ibmvnic: remove set but not used variable 'netdev'

From: Mukesh Ojha
Date: Wed Apr 03 2019 - 05:07:07 EST



On 4/3/2019 1:24 PM, Yue Haibing wrote:
From: YueHaibing <yuehaibing@xxxxxxxxxx>

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/ethernet/ibm/ibmvnic.c: In function '__ibmvnic_reset':
drivers/net/ethernet/ibm/ibmvnic.c:1971:21: warning: variable 'netdev' set but not used [-Wunused-but-set-variable]

It's never used since introduction in
commit ed651a10875f ("ibmvnic: Updated reset handling")

Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
Reviewed-by: Mukesh Ojha <mojha@xxxxxxxxxxxxxx>

Cheers,
-Mukesh
---
drivers/net/ethernet/ibm/ibmvnic.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 25b8e04..20c4e08 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1968,13 +1968,11 @@ static void __ibmvnic_reset(struct work_struct *work)
{
struct ibmvnic_rwi *rwi;
struct ibmvnic_adapter *adapter;
- struct net_device *netdev;
bool we_lock_rtnl = false;
u32 reset_state;
int rc = 0;
adapter = container_of(work, struct ibmvnic_adapter, ibmvnic_reset);
- netdev = adapter->netdev;
/* netif_set_real_num_xx_queues needs to take rtnl lock here
* unless wait_for_reset is set, in which case the rtnl lock