linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging/ks7070: Removed unused varibale
@ 2019-02-23  6:39 Bo YU
  2019-02-23  6:46 ` Sergio Paracuellos
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bo YU @ 2019-02-23  6:39 UTC (permalink / raw)
  To: gregkh, sergio.paracuellos, quytelda; +Cc: Bo Yu, devel, linux-kernel, yuzibode

From: Bo Yu <tsu.yubo@gmail.com>

Compiling the kernel with W=1 results in the following warning:

drivers/staging/ks7010/ks_hostif.c:465:6: warning: variable ‘mib_val_type’
set but not used [-Wunused-but-set-variable]
  u16 mib_val_type;

drivers/staging/ks7010/ks_hostif.c:464:6: warning: variable ‘mib_val_size’
set but not used [-Wunused-but-set-variable]
    u16 mib_val_size;

drivers/staging/ks7010/ks_hostif.c:786:6: warning: variable ‘result_code’
set but not used [-Wunused-but-set-variable]
      u16 result_code;

Remove these variables.

Rebase on next-20190222

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Cc: Quytelda Kahja <quytelda@tamalin.org>

Signed-off-by: Bo Yu <tsu.yubo@gmail.com>
---
 drivers/staging/ks7010/ks_hostif.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index d938b0997a53..913d8996437a 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -461,13 +461,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
 	struct net_device *dev = priv->net_dev;
 	u32 mib_status;
 	u32 mib_attribute;
-	u16 mib_val_size;
-	u16 mib_val_type;
 
 	mib_status = get_dword(priv);
 	mib_attribute = get_dword(priv);
-	mib_val_size = get_word(priv);
-	mib_val_type = get_word(priv);
 
 	if (mib_status) {
 		netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
@@ -783,9 +779,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private *priv)
 static
 void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
 {
-	u16 result_code;
 
-	result_code = get_word(priv);
 	priv->infra_status = 1;	/* infrastructure mode set */
 	hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM);
 }
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging/ks7070: Removed unused varibale
  2019-02-23  6:39 [PATCH] staging/ks7070: Removed unused varibale Bo YU
@ 2019-02-23  6:46 ` Sergio Paracuellos
  2019-02-23  7:18 ` Dan Carpenter
  2019-02-23  7:43 ` Greg KH
  2 siblings, 0 replies; 6+ messages in thread
From: Sergio Paracuellos @ 2019-02-23  6:46 UTC (permalink / raw)
  To: Bo YU; +Cc: Greg KH, quytelda, devel, linux-kernel, yuzibode

Hi Bo,

On Sat, Feb 23, 2019 at 7:39 AM Bo YU <tsu.yubo@gmail.com> wrote:
>
> From: Bo Yu <tsu.yubo@gmail.com>
>
> Compiling the kernel with W=1 results in the following warning:
>
> drivers/staging/ks7010/ks_hostif.c:465:6: warning: variable ‘mib_val_type’
> set but not used [-Wunused-but-set-variable]
>   u16 mib_val_type;
>
> drivers/staging/ks7010/ks_hostif.c:464:6: warning: variable ‘mib_val_size’
> set but not used [-Wunused-but-set-variable]
>     u16 mib_val_size;
>
> drivers/staging/ks7010/ks_hostif.c:786:6: warning: variable ‘result_code’
> set but not used [-Wunused-but-set-variable]
>       u16 result_code;
>
> Remove these variables.
>
> Rebase on next-20190222
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> Cc: Quytelda Kahja <quytelda@tamalin.org>
>
> Signed-off-by: Bo Yu <tsu.yubo@gmail.com>
> ---
>  drivers/staging/ks7010/ks_hostif.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> index d938b0997a53..913d8996437a 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -461,13 +461,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
>         struct net_device *dev = priv->net_dev;
>         u32 mib_status;
>         u32 mib_attribute;
> -       u16 mib_val_size;
> -       u16 mib_val_type;
>
>         mib_status = get_dword(priv);
>         mib_attribute = get_dword(priv);
> -       mib_val_size = get_word(priv);
> -       mib_val_type = get_word(priv);
>
>         if (mib_status) {
>                 netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
> @@ -783,9 +779,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private *priv)
>  static
>  void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
>  {
> -       u16 result_code;
>
> -       result_code = get_word(priv);
>         priv->infra_status = 1; /* infrastructure mode set */
>         hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM);
>  }
> --
> 2.11.0
>

PATCH commit message is wrong: format, typos and driver name:

[PATCH] staging/ks7070: Removed unused varibale

Should be "staging: ks7010: removed unused variables"

Thanks,
    Sergio Paracuellos

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging/ks7070: Removed unused varibale
  2019-02-23  6:39 [PATCH] staging/ks7070: Removed unused varibale Bo YU
  2019-02-23  6:46 ` Sergio Paracuellos
@ 2019-02-23  7:18 ` Dan Carpenter
  2019-02-23  7:43 ` Greg KH
  2 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2019-02-23  7:18 UTC (permalink / raw)
  To: Bo YU; +Cc: gregkh, sergio.paracuellos, quytelda, devel, linux-kernel, yuzibode

On Sat, Feb 23, 2019 at 01:39:39AM -0500, Bo YU wrote:
> From: Bo Yu <tsu.yubo@gmail.com>
> 
> Compiling the kernel with W=1 results in the following warning:
> 
> drivers/staging/ks7010/ks_hostif.c:465:6: warning: variable ‘mib_val_type’
> set but not used [-Wunused-but-set-variable]
>   u16 mib_val_type;
> 
> drivers/staging/ks7010/ks_hostif.c:464:6: warning: variable ‘mib_val_size’
> set but not used [-Wunused-but-set-variable]
>     u16 mib_val_size;
> 
> drivers/staging/ks7010/ks_hostif.c:786:6: warning: variable ‘result_code’
> set but not used [-Wunused-but-set-variable]
>       u16 result_code;
> 
> Remove these variables.
> 
> Rebase on next-20190222
  ^^^^^^^^^^^^^^^^^^^^^^^
Is this a v2 patch or something?  Don't include this in the changelog.
Put it under the --- cut off line.

> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> Cc: Quytelda Kahja <quytelda@tamalin.org>
> 
> Signed-off-by: Bo Yu <tsu.yubo@gmail.com>
> ---
  ^^^

>  drivers/staging/ks7010/ks_hostif.c | 6 ------
>  1 file changed, 6 deletions(-)
> 

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging/ks7070: Removed unused varibale
  2019-02-23  6:39 [PATCH] staging/ks7070: Removed unused varibale Bo YU
  2019-02-23  6:46 ` Sergio Paracuellos
  2019-02-23  7:18 ` Dan Carpenter
@ 2019-02-23  7:43 ` Greg KH
  2019-02-23  8:09   ` YU Bo
  2 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2019-02-23  7:43 UTC (permalink / raw)
  To: Bo YU; +Cc: sergio.paracuellos, quytelda, devel, linux-kernel, yuzibode

On Sat, Feb 23, 2019 at 01:39:39AM -0500, Bo YU wrote:
> From: Bo Yu <tsu.yubo@gmail.com>
> 
> Compiling the kernel with W=1 results in the following warning:
> 
> drivers/staging/ks7010/ks_hostif.c:465:6: warning: variable ‘mib_val_type’
> set but not used [-Wunused-but-set-variable]
>   u16 mib_val_type;
> 
> drivers/staging/ks7010/ks_hostif.c:464:6: warning: variable ‘mib_val_size’
> set but not used [-Wunused-but-set-variable]
>     u16 mib_val_size;
> 
> drivers/staging/ks7010/ks_hostif.c:786:6: warning: variable ‘result_code’
> set but not used [-Wunused-but-set-variable]
>       u16 result_code;
> 
> Remove these variables.
> 
> Rebase on next-20190222
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> Cc: Quytelda Kahja <quytelda@tamalin.org>
> 
> Signed-off-by: Bo Yu <tsu.yubo@gmail.com>
> ---
>  drivers/staging/ks7010/ks_hostif.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> index d938b0997a53..913d8996437a 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -461,13 +461,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
>  	struct net_device *dev = priv->net_dev;
>  	u32 mib_status;
>  	u32 mib_attribute;
> -	u16 mib_val_size;
> -	u16 mib_val_type;
>  
>  	mib_status = get_dword(priv);
>  	mib_attribute = get_dword(priv);
> -	mib_val_size = get_word(priv);
> -	mib_val_type = get_word(priv);

The function get_word() actually does something to the priv structure,
so you just broke the driver :(

>  
>  	if (mib_status) {
>  		netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
> @@ -783,9 +779,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private *priv)
>  static
>  void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
>  {
> -	u16 result_code;
>  
> -	result_code = get_word(priv);
>  	priv->infra_status = 1;	/* infrastructure mode set */
>  	hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM);

Same here, odds are you just broke things :(

Please be more careful.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging/ks7070: Removed unused varibale
  2019-02-23  7:43 ` Greg KH
@ 2019-02-23  8:09   ` YU Bo
  2019-02-23  8:38     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: YU Bo @ 2019-02-23  8:09 UTC (permalink / raw)
  To: Greg KH; +Cc: sergio.paracuellos, quytelda, devel, linux-kernel, yuzibode

On Sat, Feb 23, 2019 at 08:43:20AM +0100, Greg KH wrote:
>On Sat, Feb 23, 2019 at 01:39:39AM -0500, Bo YU wrote:
>> From: Bo Yu <tsu.yubo@gmail.com>
>>
>> Compiling the kernel with W=1 results in the following warning:
>>
>> drivers/staging/ks7010/ks_hostif.c:465:6: warning: variable ‘mib_val_type’
>> set but not used [-Wunused-but-set-variable]
>>   u16 mib_val_type;
>>
>> drivers/staging/ks7010/ks_hostif.c:464:6: warning: variable ‘mib_val_size’
>> set but not used [-Wunused-but-set-variable]
>>     u16 mib_val_size;
>>
>> drivers/staging/ks7010/ks_hostif.c:786:6: warning: variable ‘result_code’
>> set but not used [-Wunused-but-set-variable]
>>       u16 result_code;
>>
>> Remove these variables.
>>
>> Rebase on next-20190222
>>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com>
>> Cc: Quytelda Kahja <quytelda@tamalin.org>
>>
>> Signed-off-by: Bo Yu <tsu.yubo@gmail.com>
>> ---
>>  drivers/staging/ks7010/ks_hostif.c | 6 ------
>>  1 file changed, 6 deletions(-)
>>
>> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
>> index d938b0997a53..913d8996437a 100644
>> --- a/drivers/staging/ks7010/ks_hostif.c
>> +++ b/drivers/staging/ks7010/ks_hostif.c
>> @@ -461,13 +461,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
>>  	struct net_device *dev = priv->net_dev;
>>  	u32 mib_status;
>>  	u32 mib_attribute;
>> -	u16 mib_val_size;
>> -	u16 mib_val_type;
>>
>>  	mib_status = get_dword(priv);
>>  	mib_attribute = get_dword(priv);
>> -	mib_val_size = get_word(priv);
>> -	mib_val_type = get_word(priv);
>
>The function get_word() actually does something to the priv structure,
>so you just broke the driver :(
>
>>
>>  	if (mib_status) {
>>  		netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
>> @@ -783,9 +779,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private *priv)
>>  static
>>  void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
>>  {
>> -	u16 result_code;
>>
>> -	result_code = get_word(priv);
>>  	priv->infra_status = 1;	/* infrastructure mode set */
>>  	hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM);
>
>Same here, odds are you just broke things :(
>
>Please be more careful.
Ok, I have through get_word() and get_byte() before modifing the code.
I think it should be better to encapsulate get_word without return value to do some operations
like that? right?
>
>greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging/ks7070: Removed unused varibale
  2019-02-23  8:09   ` YU Bo
@ 2019-02-23  8:38     ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2019-02-23  8:38 UTC (permalink / raw)
  To: sergio.paracuellos, quytelda, devel, linux-kernel, yuzibode

On Sat, Feb 23, 2019 at 03:09:42AM -0500, YU Bo wrote:
> On Sat, Feb 23, 2019 at 08:43:20AM +0100, Greg KH wrote:
> > On Sat, Feb 23, 2019 at 01:39:39AM -0500, Bo YU wrote:
> > > From: Bo Yu <tsu.yubo@gmail.com>
> > > 
> > > Compiling the kernel with W=1 results in the following warning:
> > > 
> > > drivers/staging/ks7010/ks_hostif.c:465:6: warning: variable ‘mib_val_type’
> > > set but not used [-Wunused-but-set-variable]
> > >   u16 mib_val_type;
> > > 
> > > drivers/staging/ks7010/ks_hostif.c:464:6: warning: variable ‘mib_val_size’
> > > set but not used [-Wunused-but-set-variable]
> > >     u16 mib_val_size;
> > > 
> > > drivers/staging/ks7010/ks_hostif.c:786:6: warning: variable ‘result_code’
> > > set but not used [-Wunused-but-set-variable]
> > >       u16 result_code;
> > > 
> > > Remove these variables.
> > > 
> > > Rebase on next-20190222
> > > 
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Cc: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > > Cc: Quytelda Kahja <quytelda@tamalin.org>
> > > 
> > > Signed-off-by: Bo Yu <tsu.yubo@gmail.com>
> > > ---
> > >  drivers/staging/ks7010/ks_hostif.c | 6 ------
> > >  1 file changed, 6 deletions(-)
> > > 
> > > diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> > > index d938b0997a53..913d8996437a 100644
> > > --- a/drivers/staging/ks7010/ks_hostif.c
> > > +++ b/drivers/staging/ks7010/ks_hostif.c
> > > @@ -461,13 +461,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
> > >  	struct net_device *dev = priv->net_dev;
> > >  	u32 mib_status;
> > >  	u32 mib_attribute;
> > > -	u16 mib_val_size;
> > > -	u16 mib_val_type;
> > > 
> > >  	mib_status = get_dword(priv);
> > >  	mib_attribute = get_dword(priv);
> > > -	mib_val_size = get_word(priv);
> > > -	mib_val_type = get_word(priv);
> > 
> > The function get_word() actually does something to the priv structure,
> > so you just broke the driver :(
> > 
> > > 
> > >  	if (mib_status) {
> > >  		netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n",
> > > @@ -783,9 +779,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private *priv)
> > >  static
> > >  void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv)
> > >  {
> > > -	u16 result_code;
> > > 
> > > -	result_code = get_word(priv);
> > >  	priv->infra_status = 1;	/* infrastructure mode set */
> > >  	hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM);
> > 
> > Same here, odds are you just broke things :(
> > 
> > Please be more careful.
> Ok, I have through get_word() and get_byte() before modifing the code.
> I think it should be better to encapsulate get_word without return value to do some operations
> like that? right?

Something should be done, as that api is pretty horrible.  But I think
that might be a lot more work to accomplish :)

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-23  8:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-23  6:39 [PATCH] staging/ks7070: Removed unused varibale Bo YU
2019-02-23  6:46 ` Sergio Paracuellos
2019-02-23  7:18 ` Dan Carpenter
2019-02-23  7:43 ` Greg KH
2019-02-23  8:09   ` YU Bo
2019-02-23  8:38     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).