mac80211-next: remove set but not used variable 'w_priv'
diff mbox series

Message ID 1545274318-144187-1-git-send-email-yuehaibing@huawei.com
State Superseded
Delegated to: Johannes Berg
Headers show
Series
  • mac80211-next: remove set but not used variable 'w_priv'
Related show

Commit Message

Yuehaibing Dec. 20, 2018, 2:51 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/virt_wifi.c: In function 'virt_wifi_net_device_stop':
drivers/net/wireless/virt_wifi.c:432:31: warning:
 variable 'w_priv' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/wireless/virt_wifi.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Yuehaibing Jan. 16, 2019, 12:24 p.m. UTC | #1
ping...

On 2018/12/20 10:51, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/wireless/virt_wifi.c: In function 'virt_wifi_net_device_stop':
> drivers/net/wireless/virt_wifi.c:432:31: warning:
>  variable 'w_priv' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/net/wireless/virt_wifi.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c
> index 64b2186..ea10f58 100644
> --- a/drivers/net/wireless/virt_wifi.c
> +++ b/drivers/net/wireless/virt_wifi.c
> @@ -429,13 +429,11 @@ static int virt_wifi_net_device_open(struct net_device *dev)
>  static int virt_wifi_net_device_stop(struct net_device *dev)
>  {
>  	struct virt_wifi_netdev_priv *n_priv = netdev_priv(dev);
> -	struct virt_wifi_wiphy_priv *w_priv;
>  
>  	n_priv->is_up = false;
>  
>  	if (!dev->ieee80211_ptr)
>  		return 0;
> -	w_priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
>  
>  	virt_wifi_cancel_scan(dev->ieee80211_ptr->wiphy);
>  	virt_wifi_cancel_connect(dev);
> 
> 
> 
> 
> .
>
Kalle Valo Jan. 16, 2019, 4:09 p.m. UTC | #2
YueHaibing <yuehaibing@huawei.com> writes:

> ping...
>
> On 2018/12/20 10:51, YueHaibing wrote:
>> Fixes gcc '-Wunused-but-set-variable' warning:
>> 
>> drivers/net/wireless/virt_wifi.c: In function 'virt_wifi_net_device_stop':
>> drivers/net/wireless/virt_wifi.c:432:31: warning:
>>  variable 'w_priv' set but not used [-Wunused-but-set-variable]
>> 
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Same here, the prefix should be "virt_wifi:".

Patch
diff mbox series

diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c
index 64b2186..ea10f58 100644
--- a/drivers/net/wireless/virt_wifi.c
+++ b/drivers/net/wireless/virt_wifi.c
@@ -429,13 +429,11 @@  static int virt_wifi_net_device_open(struct net_device *dev)
 static int virt_wifi_net_device_stop(struct net_device *dev)
 {
 	struct virt_wifi_netdev_priv *n_priv = netdev_priv(dev);
-	struct virt_wifi_wiphy_priv *w_priv;
 
 	n_priv->is_up = false;
 
 	if (!dev->ieee80211_ptr)
 		return 0;
-	w_priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
 
 	virt_wifi_cancel_scan(dev->ieee80211_ptr->wiphy);
 	virt_wifi_cancel_connect(dev);