diff mbox series

[v2] rsi: remove set but not used variable 'header_size'

Message ID 20180831111325.16984-1-yuehaibing@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series [v2] rsi: remove set but not used variable 'header_size' | expand

Commit Message

Yue Haibing Aug. 31, 2018, 11:13 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/rsi/rsi_91x_hal.c: In function 'rsi_send_data_pkt':
drivers/net/wireless/rsi/rsi_91x_hal.c:288:5: warning:
 variable 'header_size' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: remove unused 'tx_params'
---
 drivers/net/wireless/rsi/rsi_91x_hal.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Siva Rebbagondla Sept. 1, 2018, 3:41 a.m. UTC | #1
On Fri, Aug 31, 2018 at 4:45 PM YueHaibing <yuehaibing@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/wireless/rsi/rsi_91x_hal.c: In function 'rsi_send_data_pkt':
> drivers/net/wireless/rsi/rsi_91x_hal.c:288:5: warning:
>  variable 'header_size' set but not used [-Wunused-but-set-variable]
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: remove unused 'tx_params'
> ---
>  drivers/net/wireless/rsi/rsi_91x_hal.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c
> index 01edf96..182b066 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_hal.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
> @@ -282,10 +282,8 @@ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb)
>         struct rsi_hw *adapter = common->priv;
>         struct ieee80211_vif *vif;
>         struct ieee80211_tx_info *info;
> -       struct skb_info *tx_params;
>         struct ieee80211_bss_conf *bss;
>         int status = -EINVAL;
> -       u8 header_size;
>
>         if (!skb)
>                 return 0;
> @@ -297,8 +295,6 @@ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb)
>                 goto err;
>         vif = info->control.vif;
>         bss = &vif->bss_conf;
> -       tx_params = (struct skb_info *)info->driver_data;
> -       header_size = tx_params->internal_hdr_size;
Yes, These redundant variables shall be removed.
>
>         if (((vif->type == NL80211_IFTYPE_STATION) ||
>              (vif->type == NL80211_IFTYPE_P2P_CLIENT)) &&
> --
> 2.7.0
>
>
Also, Patch title also can be changed to "[v2] rsi: remove unused variables"

Thanks,
Siva Rebbagondla
Yue Haibing Sept. 1, 2018, 6:54 a.m. UTC | #2
On 2018/9/1 11:41, Siva Rebbagondla wrote:
> On Fri, Aug 31, 2018 at 4:45 PM YueHaibing <yuehaibing@huawei.com> wrote:
>>
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> drivers/net/wireless/rsi/rsi_91x_hal.c: In function 'rsi_send_data_pkt':
>> drivers/net/wireless/rsi/rsi_91x_hal.c:288:5: warning:
>>  variable 'header_size' set but not used [-Wunused-but-set-variable]
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>> v2: remove unused 'tx_params'
>> ---
>>  drivers/net/wireless/rsi/rsi_91x_hal.c | 4 ----
>>  1 file changed, 4 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c
>> index 01edf96..182b066 100644
>> --- a/drivers/net/wireless/rsi/rsi_91x_hal.c
>> +++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
>> @@ -282,10 +282,8 @@ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb)
>>         struct rsi_hw *adapter = common->priv;
>>         struct ieee80211_vif *vif;
>>         struct ieee80211_tx_info *info;
>> -       struct skb_info *tx_params;
>>         struct ieee80211_bss_conf *bss;
>>         int status = -EINVAL;
>> -       u8 header_size;
>>
>>         if (!skb)
>>                 return 0;
>> @@ -297,8 +295,6 @@ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb)
>>                 goto err;
>>         vif = info->control.vif;
>>         bss = &vif->bss_conf;
>> -       tx_params = (struct skb_info *)info->driver_data;
>> -       header_size = tx_params->internal_hdr_size;
> Yes, These redundant variables shall be removed.
>>
>>         if (((vif->type == NL80211_IFTYPE_STATION) ||
>>              (vif->type == NL80211_IFTYPE_P2P_CLIENT)) &&
>> --
>> 2.7.0
>>
>>
> Also, Patch title also can be changed to "[v2] rsi: remove unused variables"

Ok, will fix in v3.

Thank you.

> 
> Thanks,
> Siva Rebbagondla
> 
> .
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c
index 01edf96..182b066 100644
--- a/drivers/net/wireless/rsi/rsi_91x_hal.c
+++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
@@ -282,10 +282,8 @@  int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb)
 	struct rsi_hw *adapter = common->priv;
 	struct ieee80211_vif *vif;
 	struct ieee80211_tx_info *info;
-	struct skb_info *tx_params;
 	struct ieee80211_bss_conf *bss;
 	int status = -EINVAL;
-	u8 header_size;
 
 	if (!skb)
 		return 0;
@@ -297,8 +295,6 @@  int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb)
 		goto err;
 	vif = info->control.vif;
 	bss = &vif->bss_conf;
-	tx_params = (struct skb_info *)info->driver_data;
-	header_size = tx_params->internal_hdr_size;
 
 	if (((vif->type == NL80211_IFTYPE_STATION) ||
 	     (vif->type == NL80211_IFTYPE_P2P_CLIENT)) &&