linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]hostap:hostap_ioctl.c Fix variable 'ret' set but not used
@ 2010-08-03  0:04 Justin P. Mattock
  2010-08-03  0:15 ` Luis R. Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Justin P. Mattock @ 2010-08-03  0:04 UTC (permalink / raw)
  To: linux-wireless; +Cc: netdev, linux-kernel, j, linville, Justin P. Mattock

The below patch fixes a warning message generated by GCC:
  CC [M]  drivers/net/wireless/hostap/hostap_ioctl.o
drivers/net/wireless/hostap/hostap_ioctl.c: In function 'prism2_request_scan':
drivers/net/wireless/hostap/hostap_ioctl.c:1666:6: warning: variable 'ret' set but not used

Keep in mind Im not sure if this is the right fix for this, so please
feedback is appreciated.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>

---
 drivers/net/wireless/hostap/hostap_ioctl.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index a85e43a..27d462f 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1663,7 +1663,6 @@ static int prism2_request_scan(struct net_device *dev)
 	struct hostap_interface *iface;
 	local_info_t *local;
 	struct hfa384x_scan_request scan_req;
-	int ret = 0;
 
 	iface = netdev_priv(dev);
 	local = iface->local;
@@ -1689,7 +1688,7 @@ static int prism2_request_scan(struct net_device *dev)
 	if (local->func->set_rid(dev, HFA384X_RID_SCANREQUEST, &scan_req,
 				 sizeof(scan_req))) {
 		printk(KERN_DEBUG "SCANREQUEST failed\n");
-		ret = -EINVAL;
+		return -EINVAL;
 	}
 
 	if (!local->host_roaming)
-- 
1.7.1.rc1.21.gf3bd6


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

* Re: [PATCH]hostap:hostap_ioctl.c Fix variable 'ret' set but not used
  2010-08-03  0:04 [PATCH]hostap:hostap_ioctl.c Fix variable 'ret' set but not used Justin P. Mattock
@ 2010-08-03  0:15 ` Luis R. Rodriguez
  2010-08-03  0:16   ` Luis R. Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Luis R. Rodriguez @ 2010-08-03  0:15 UTC (permalink / raw)
  To: Justin P. Mattock; +Cc: linux-wireless, netdev, linux-kernel, j, linville

On Mon, Aug 2, 2010 at 5:04 PM, Justin P. Mattock
<justinmattock@gmail.com> wrote:
> The below patch fixes a warning message generated by GCC:
>  CC [M]  drivers/net/wireless/hostap/hostap_ioctl.o
> drivers/net/wireless/hostap/hostap_ioctl.c: In function 'prism2_request_scan':
> drivers/net/wireless/hostap/hostap_ioctl.c:1666:6: warning: variable 'ret' set but not used
>
> Keep in mind Im not sure if this is the right fix for this, so please
> feedback is appreciated.
>
> Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
>
> ---
>  drivers/net/wireless/hostap/hostap_ioctl.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
> index a85e43a..27d462f 100644
> --- a/drivers/net/wireless/hostap/hostap_ioctl.c
> +++ b/drivers/net/wireless/hostap/hostap_ioctl.c
> @@ -1663,7 +1663,6 @@ static int prism2_request_scan(struct net_device *dev)
>        struct hostap_interface *iface;
>        local_info_t *local;
>        struct hfa384x_scan_request scan_req;
> -       int ret = 0;
>
>        iface = netdev_priv(dev);
>        local = iface->local;
> @@ -1689,7 +1688,7 @@ static int prism2_request_scan(struct net_device *dev)
>        if (local->func->set_rid(dev, HFA384X_RID_SCANREQUEST, &scan_req,
>                                 sizeof(scan_req))) {
>                printk(KERN_DEBUG "SCANREQUEST failed\n");
> -               ret = -EINVAL;
> +               return -EINVAL;
>        }
>
>        if (!local->host_roaming)

NACK please read the code instead of just patching blindly to cure a
compile issue. For example read this big block:


        /* FIX:
         * It seems to be enough to set roaming mode for a short moment to
         * host-based and then setup scanrequest data and return the mode to
         * firmware-based.
         *
         * Master mode would need to drop to Managed mode for a short while
         * to make scanning work.. Or sweep through the different channels and
         * use passive scan based on beacons. */

So.. it seems to me you likely want to flip back to
HFA384X_ROAMING_FIRMWARE *after* you've tried to issue the
HFA384X_RID_SCANREQUEST, even if it has failed. So the compile fix
should require just changing the last return statement of the function
to return ret value.

  Luis

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

* Re: [PATCH]hostap:hostap_ioctl.c Fix variable 'ret' set but not used
  2010-08-03  0:15 ` Luis R. Rodriguez
@ 2010-08-03  0:16   ` Luis R. Rodriguez
  2010-08-03  0:37     ` Justin P. Mattock
  0 siblings, 1 reply; 4+ messages in thread
From: Luis R. Rodriguez @ 2010-08-03  0:16 UTC (permalink / raw)
  To: Justin P. Mattock; +Cc: linux-wireless, netdev, linux-kernel, j, linville

On Mon, Aug 2, 2010 at 5:15 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> On Mon, Aug 2, 2010 at 5:04 PM, Justin P. Mattock
> <justinmattock@gmail.com> wrote:
>> The below patch fixes a warning message generated by GCC:
>>  CC [M]  drivers/net/wireless/hostap/hostap_ioctl.o
>> drivers/net/wireless/hostap/hostap_ioctl.c: In function 'prism2_request_scan':
>> drivers/net/wireless/hostap/hostap_ioctl.c:1666:6: warning: variable 'ret' set but not used
>>
>> Keep in mind Im not sure if this is the right fix for this, so please
>> feedback is appreciated.
>>
>> Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
>>
>> ---
>>  drivers/net/wireless/hostap/hostap_ioctl.c |    3 +--
>>  1 files changed, 1 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
>> index a85e43a..27d462f 100644
>> --- a/drivers/net/wireless/hostap/hostap_ioctl.c
>> +++ b/drivers/net/wireless/hostap/hostap_ioctl.c
>> @@ -1663,7 +1663,6 @@ static int prism2_request_scan(struct net_device *dev)
>>        struct hostap_interface *iface;
>>        local_info_t *local;
>>        struct hfa384x_scan_request scan_req;
>> -       int ret = 0;
>>
>>        iface = netdev_priv(dev);
>>        local = iface->local;
>> @@ -1689,7 +1688,7 @@ static int prism2_request_scan(struct net_device *dev)
>>        if (local->func->set_rid(dev, HFA384X_RID_SCANREQUEST, &scan_req,
>>                                 sizeof(scan_req))) {
>>                printk(KERN_DEBUG "SCANREQUEST failed\n");
>> -               ret = -EINVAL;
>> +               return -EINVAL;
>>        }
>>
>>        if (!local->host_roaming)
>
> NACK please read the code instead of just patching blindly to cure a
> compile issue. For example read this big block:
>
>
>        /* FIX:
>         * It seems to be enough to set roaming mode for a short moment to
>         * host-based and then setup scanrequest data and return the mode to
>         * firmware-based.
>         *
>         * Master mode would need to drop to Managed mode for a short while
>         * to make scanning work.. Or sweep through the different channels and
>         * use passive scan based on beacons. */
>
> So.. it seems to me you likely want to flip back to
> HFA384X_ROAMING_FIRMWARE *after* you've tried to issue the
> HFA384X_RID_SCANREQUEST, even if it has failed. So the compile fix
> should require just changing the last return statement of the function
> to return ret value.

And for 802.11 there is no need to cc netdev and lkml. Just use linux-wireless.

  Luis

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

* Re: [PATCH]hostap:hostap_ioctl.c Fix variable 'ret' set but not used
  2010-08-03  0:16   ` Luis R. Rodriguez
@ 2010-08-03  0:37     ` Justin P. Mattock
  0 siblings, 0 replies; 4+ messages in thread
From: Justin P. Mattock @ 2010-08-03  0:37 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, j, linville

On 08/02/2010 05:16 PM, Luis R. Rodriguez wrote:
> On Mon, Aug 2, 2010 at 5:15 PM, Luis R. Rodriguez<mcgrof@gmail.com>  wrote:
>> On Mon, Aug 2, 2010 at 5:04 PM, Justin P. Mattock
>> <justinmattock@gmail.com>  wrote:
>>> The below patch fixes a warning message generated by GCC:
>>>   CC [M]  drivers/net/wireless/hostap/hostap_ioctl.o
>>> drivers/net/wireless/hostap/hostap_ioctl.c: In function 'prism2_request_scan':
>>> drivers/net/wireless/hostap/hostap_ioctl.c:1666:6: warning: variable 'ret' set but not used
>>>
>>> Keep in mind Im not sure if this is the right fix for this, so please
>>> feedback is appreciated.
>>>
>>> Signed-off-by: Justin P. Mattock<justinmattock@gmail.com>
>>>
>>> ---
>>>   drivers/net/wireless/hostap/hostap_ioctl.c |    3 +--
>>>   1 files changed, 1 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
>>> index a85e43a..27d462f 100644
>>> --- a/drivers/net/wireless/hostap/hostap_ioctl.c
>>> +++ b/drivers/net/wireless/hostap/hostap_ioctl.c
>>> @@ -1663,7 +1663,6 @@ static int prism2_request_scan(struct net_device *dev)
>>>         struct hostap_interface *iface;
>>>         local_info_t *local;
>>>         struct hfa384x_scan_request scan_req;
>>> -       int ret = 0;
>>>
>>>         iface = netdev_priv(dev);
>>>         local = iface->local;
>>> @@ -1689,7 +1688,7 @@ static int prism2_request_scan(struct net_device *dev)
>>>         if (local->func->set_rid(dev, HFA384X_RID_SCANREQUEST,&scan_req,
>>>                                  sizeof(scan_req))) {
>>>                 printk(KERN_DEBUG "SCANREQUEST failed\n");
>>> -               ret = -EINVAL;
>>> +               return -EINVAL;
>>>         }
>>>
>>>         if (!local->host_roaming)
>>
>> NACK please read the code instead of just patching blindly to cure a
>> compile issue. For example read this big block:

I suppose I did look blindly.. the whole ret = 0; then ret = *
got me.. then I figured maybe its just a return.

>>
>>
>>         /* FIX:
>>          * It seems to be enough to set roaming mode for a short moment to
>>          * host-based and then setup scanrequest data and return the mode to
>>          * firmware-based.
>>          *
>>          * Master mode would need to drop to Managed mode for a short while
>>          * to make scanning work.. Or sweep through the different channels and
>>          * use passive scan based on beacons. */
>>
>> So.. it seems to me you likely want to flip back to
>> HFA384X_ROAMING_FIRMWARE *after* you've tried to issue the
>> HFA384X_RID_SCANREQUEST, even if it has failed. So the compile fix
>> should require just changing the last return statement of the function
>> to return ret value.

so this is a simple return ret;

>
> And for 802.11 there is no need to cc netdev and lkml. Just use linux-wireless.
>
>    Luis
>

is netdev even used nowadays?
anyways I'll resend this. Thanks for the feedback and info..

Justin P. Mattock

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

end of thread, other threads:[~2010-08-03  0:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-03  0:04 [PATCH]hostap:hostap_ioctl.c Fix variable 'ret' set but not used Justin P. Mattock
2010-08-03  0:15 ` Luis R. Rodriguez
2010-08-03  0:16   ` Luis R. Rodriguez
2010-08-03  0:37     ` Justin P. Mattock

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).