[PATCH] rtl8xxxu: Fix trailing semicolon

2018-01-17 Thread Luis de Bethencourt
The trailing semicolon is an empty statement that does no operation.
Removing it since it doesn't do anything.

Signed-off-by: Luis de Bethencourt <lui...@kernel.org>
---

Hi,

After fixing the same thing in drivers/staging/rtl8723bs/, Joe Perches
suggested I fix it treewide [0].

Best regards 
Luis


[0] 
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-January/115410.html
[1] 
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-January/115390.html

 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 95e3993d8a33..8828baf26e7b 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1172,7 +1172,7 @@ struct rtl8723bu_c2h {
 
u8 basic_rate:1;
u8 bt_has_reset:1;
-   u8 dummy4_1:1;;
+   u8 dummy4_1:1;
u8 ignore_wlan:1;
u8 auto_report:1;
u8 dummy4_2:3;
-- 
2.15.1



Re: + maintainers-remove-unreachable-people-that-have-left-atmel.patch added to -mm tree

2016-07-11 Thread Luis de Bethencourt
On 11/07/16 23:59, a...@linux-foundation.org wrote:
> 
> The patch titled
>  Subject: MAINTAINERS: remove unreachable people that have left Atmel
> has been added to the -mm tree.  Its filename is
>  maintainers-remove-unreachable-people-that-have-left-atmel.patch
> 
> This patch should soon appear at
> 
> http://ozlabs.org/~akpm/mmots/broken-out/maintainers-remove-unreachable-people-that-have-left-atmel.patch
> and later at
> 
> http://ozlabs.org/~akpm/mmotm/broken-out/maintainers-remove-unreachable-people-that-have-left-atmel.patch
> 
> Before you just go and hit "reply", please:
>a) Consider who else should be cc'ed
>b) Prefer to cc a suitable mailing list as well
>c) Ideally: find the original patch on the mailing list and do a
>   reply-to-all to that, adding suitable additional cc's
> 
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
> 
> The -mm tree is included into linux-next and is updated
> there every 3-4 working days
> 
> --
> From: Luis de Bethencourt <lui...@osg.samsung.com>
> Subject: MAINTAINERS: remove unreachable people that have left Atmel
> 
> When sending an email regarding a patch to wilc1000, you get the following
> automatic replies:
> "Sung_hoon Cho is no longer with Atmel Corporation."
> "Kang_hee Park is no longer with Atmel Corporation."
> "Dong_ho Shin is no longer with Atmel Corporation."
> "Bo_moon Kim is no longer with Atmel Corporation."
> "Min_su Kim is no longer with Atmel Corporation."
> "Jun_hyuk Lee is no longer with Atmel Corporation."
> 
> Removing this entry since none of the maintainers are reachable.
> 
> Link: 
> http://lkml.kernel.org/r/1467033373-20967-1-git-send-email-lui...@osg.samsung.com
> Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
> Cc: Greg KH <g...@kroah.com>
> Cc: David Miller <da...@davemloft.net>
> Signed-off-by: Andrew Morton <a...@linux-foundation.org>
> ---
> 
>  MAINTAINERS |   11 ---
>  1 file changed, 11 deletions(-)
> 
> diff -puN 
> MAINTAINERS~maintainers-remove-unreachable-people-that-have-left-atmel 
> MAINTAINERS
> --- a/MAINTAINERS~maintainers-remove-unreachable-people-that-have-left-atmel
> +++ a/MAINTAINERS
> @@ -11131,17 +11131,6 @@ M:   Forest Bond <forest@alittletooquiet.n
>  S:   Odd Fixes
>  F:   drivers/staging/vt665?/
>  
> -STAGING - WILC1000 WIFI DRIVER
> -M:   Johnny Kim <johnny@atmel.com>
> -M:   Austin Shin <austin.s...@atmel.com>
> -M:   Chris Park <chris.p...@atmel.com>
> -M:   Tony Cho <tony@atmel.com>
> -M:   Glen Lee <glen@atmel.com>
> -M:   Leo Kim <leo@atmel.com>
> -L:   linux-wireless@vger.kernel.org
> -S:   Supported
> -F:   drivers/staging/wilc1000/
> -
>  STAGING - XGI Z7,Z9,Z11 PCI DISPLAY DRIVER
>  M:   Arnaud Patard <arnaud.pat...@rtp-net.org>
>  S:   Odd Fixes
> _
> 
> Patches currently in -mm which might be from lui...@osg.samsung.com are
> 
> befs-check-return-of-sb_min_blocksize.patch
> befs-fix-function-name-in-documentation.patch
> befs-remove-unused-functions.patch
> maintainers-remove-unreachable-people-that-have-left-atmel.patch
> 

Hi Andrew,

Nicolas Ferre proposed the following people instead in this reply patch:
https://lkml.org/lkml/2016/6/27/382

Sounds better than making the driver orphan. But I am not sure if this has
been approved by Greg or not. Just a heads up since I thought you might want
to know.

Thanks,
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] MAINTAINERS: Update maintainer entry for wilc1000

2016-06-27 Thread Luis de Bethencourt
On 27/06/16 15:10, Nicolas Ferre wrote:
> From: Aditya Shankar <aditya.shan...@microchip.com>
> 
> Take the maintenance of the Atmel WIFI staging driver wilc1000.
> Former maintainers are no more with Atmel.
> 
> Reported-by: Loic Lefort <loic.lef...@atmel.com>
> Signed-off-by: Aditya Shankar <aditya.shan...@microchip.com>
> Signed-off-by: Ganesh Krishna <ganesh.kris...@microchip.com>
> Signed-off-by: Nicolas Ferre <nicolas.fe...@atmel.com>
> ---
> Hi Luis, Greg, 
> 
> I'd like that we don't delete the entry for this wilc1000 driver
> but change it with the patch below.
> After the Microchip - Atmel merger, Aditya and Ganesh will take over the
> maintenance of this driver and will continue the work that our former
> colleagues started.
> 
> Thanks, bye.
> 

Nice :) This is good news

I am happy to help as well if I can get my hands on the hardware.

Acked-by: Luis de Bethencourt <lui...@osg.samsung.com>

Thanks,
Luis


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3] MAINTAINERS: remove unreachable people that have left Atmel

2016-06-27 Thread Luis de Bethencourt
When sending an email regarding a patch to wilc1000, you get the following
automatic replies:
"Sung_hoon Cho is no longer with Atmel Corporation."
"Kang_hee Park is no longer with Atmel Corporation."
"Dong_ho Shin is no longer with Atmel Corporation."
"Bo_moon Kim is no longer with Atmel Corporation."
"Min_su Kim is no longer with Atmel Corporation."
"Jun_hyuk Lee is no longer with Atmel Corporation."

Removing this entry since none of the maintainers are reachable.

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---

Hi,

This is unfortunate, but Greg recommended we drop the whole entry for now [0].

If nobody with more experience volunteers, I am happy to continue cleaning and
supporting this driver. This hardware is used by people in the Raspberry Pi
community, which is why I think it is worth it [1].

I am going to contact Atmel and see if they can provide me with a more complete
datasheet than they one in their website [2]. Since I would need this, plus the
hardware, before I can commit to anything.

Hopefully somebody from Atmel steps up since they are the experts.

Thanks,
Luis



[0] https://lkml.org/lkml/2016/6/26/202
[1] https://hackaday.io/project/9759-yet-another-pizero-wi-fi-hat
[2] http://www.atmel.com/Images/Atmel-42491-WILC1000B-MUT_Datasheet.pdf

 MAINTAINERS | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2d059dd..8bd968f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11075,17 +11075,6 @@ M: Forest Bond <for...@alittletooquiet.net>
 S: Odd Fixes
 F: drivers/staging/vt665?/
 
-STAGING - WILC1000 WIFI DRIVER
-M: Johnny Kim <johnny@atmel.com>
-M: Austin Shin <austin.s...@atmel.com>
-M: Chris Park <chris.p...@atmel.com>
-M: Tony Cho <tony@atmel.com>
-M: Glen Lee <glen@atmel.com>
-M: Leo Kim <leo@atmel.com>
-L: linux-wireless@vger.kernel.org
-S: Supported
-F: drivers/staging/wilc1000/
-
 STAGING - XGI Z7,Z9,Z11 PCI DISPLAY DRIVER
 M: Arnaud Patard <arnaud.pat...@rtp-net.org>
 S: Odd Fixes
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/2] staging: wilc1000: fix error handling in wilc_debugfs_init()

2016-06-27 Thread Luis de Bethencourt
On 25/06/16 23:16, Greg KH wrote:
> On Sat, Jun 25, 2016 at 10:43:33PM +0100, Luis de Bethencourt wrote:
>> On 25/06/16 22:36, Greg KH wrote:
>>> On Thu, Jun 23, 2016 at 01:36:17PM +0100, Luis de Bethencourt wrote:
>>>> The common format to check if a function returned an error pointer is to
>>>> use PTR_ERR(). Instead of ERR_PTR() which is used to return said errors.
>>>>
>>>> Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
>>>> Reviewed-by: Julian Calaby <julian.cal...@gmail.com>
>>>> ---
>>>>  drivers/staging/wilc1000/wilc_debugfs.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
>>>> b/drivers/staging/wilc1000/wilc_debugfs.c
>>>> index fcbc95d..48797dc 100644
>>>> --- a/drivers/staging/wilc1000/wilc_debugfs.c
>>>> +++ b/drivers/staging/wilc1000/wilc_debugfs.c
>>>> @@ -107,7 +107,7 @@ static int __init wilc_debugfs_init(void)
>>>>struct wilc_debugfs_info_t *info;
>>>>  
>>>>wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
>>>> -  if (wilc_dir ==  ERR_PTR(-ENODEV)) {
>>>> +  if (PTR_ERR(wilc_dir) == -ENODEV) {
>>>>/* it's not error. the debugfs is just not being enabled. */
>>>>printk("ERR, kernel has built without debugfs support\n");
>>>>return 0;
>>>
>>> No, the best way to do this is to just ignore the return value, you
>>> don't care about it.  It can be passed back into any debugfs calls just
>>> fine.
>>>
>>> So don't check the value and all is good, debugfs was written in a way
>>> to make it _easy_ to use, no need for fancy error checking at all with
>>> it.
>>>
>>> thanks,
>>>
>>> greg k-h
>>>
>>
>> Thanks for the review Greg.
>>
>> Just to make sure. You are proposing I just drop the 3 if checks? [0]
>>
>> If that's what you mean I will send a patch as soon as you confirm :)
>>
>> Happy hacking,
>> Luis
>>
>>
>>
>> [0] Making the function look like this:
>> static int __init wilc_debugfs_init(void)
>> {
>> int i;
>>
>> struct dentry *debugfs_files;
>> struct wilc_debugfs_info_t *info;
>>
>> wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
>> for (i = 0; i < ARRAY_SIZE(debugfs_info); i++) {
>> info = _info[i];
>> debugfs_files = debugfs_create_file(info->name,
>> info->perm,
>> wilc_dir,
>> >data,
>> >fops);
> 
> Why even assign anything to debugfs_files?
> 

Sorry Greg.

I was just confirming I understood your suggestion, and pasted that
without cleaning the code.

Thanks for review and idea!
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3] staging: wilc1000: fix error handling in wilc_debugfs_init()

2016-06-27 Thread Luis de Bethencourt
We can just ignore the return value from debugfs_create_dir() and
debugfs_create_file(). The second one already interanlly checks the dentry
created by the first before creating the file.

debugfs was written so it would be easy to use, no need for error checking.

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
Suggested-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/staging/wilc1000/wilc_debugfs.c | 29 +
 1 file changed, 5 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index fcbc95d..b052628 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -102,35 +102,16 @@ static struct wilc_debugfs_info_t debugfs_info[] = {
 static int __init wilc_debugfs_init(void)
 {
int i;
-
-   struct dentry *debugfs_files;
struct wilc_debugfs_info_t *info;
 
wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
-   if (wilc_dir ==  ERR_PTR(-ENODEV)) {
-   /* it's not error. the debugfs is just not being enabled. */
-   printk("ERR, kernel has built without debugfs support\n");
-   return 0;
-   }
-
-   if (!wilc_dir) {
-   printk("ERR, debugfs create dir\n");
-   return -1;
-   }
-
for (i = 0; i < ARRAY_SIZE(debugfs_info); i++) {
info = _info[i];
-   debugfs_files = debugfs_create_file(info->name,
-   info->perm,
-   wilc_dir,
-   >data,
-   >fops);
-
-   if (!debugfs_files) {
-   printk("ERR fail to create the debugfs file, %s\n", 
info->name);
-   debugfs_remove_recursive(wilc_dir);
-   return -1;
-   }
+   debugfs_create_file(info->name,
+   info->perm,
+   wilc_dir,
+   >data,
+   >fops);
}
return 0;
 }
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH v2] MAINTAINERS: remove unreachable people that have left Atmel

2016-06-25 Thread Luis de Bethencourt
When sending an email regarding a patch to wilc1000, you get the following
automatic replies:
"Sung_hoon Cho is no longer with Atmel Corporation."
"Kang_hee Park is no longer with Atmel Corporation."
"Dong_ho Shin is no longer with Atmel Corporation."
"Bo_moon Kim is no longer with Atmel Corporation."
"Min_su Kim is no longer with Atmel Corporation."
"Jun_hyuk Lee is no longer with Atmel Corporation."

Removing these email addresses that don't reach the addressee anymore.

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---

Hi,

Just got the same automatic reply from Glen Lee's address.

This is unfortunate since it means this driver has no maintainer listed.
What do people suggest to do in this case?

I can't find an alternative email address for any of them.

Thanks,
Luis

 MAINTAINERS | 6 --
 1 file changed, 6 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe8ac28..2c713fc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11080,12 +11080,6 @@ S: Odd Fixes
 F: drivers/staging/vt665?/
 
 STAGING - WILC1000 WIFI DRIVER
-M: Johnny Kim <johnny@atmel.com>
-M: Austin Shin <austin.s...@atmel.com>
-M: Chris Park <chris.p...@atmel.com>
-M: Tony Cho <tony@atmel.com>
-M: Glen Lee <glen@atmel.com>
-M: Leo Kim <leo@atmel.com>
 L: linux-wireless@vger.kernel.org
 S: Supported
 F: drivers/staging/wilc1000/
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] MAINTAINERS: remove unreachable people that have left Atmel

2016-06-25 Thread Luis de Bethencourt
When sending an email regarding a patch to wilc1000, you get the following
automatic replies:
"Sung_hoon Cho is no longer with Atmel Corporation."
"Kang_hee Park is no longer with Atmel Corporation."
"Dong_ho Shin is no longer with Atmel Corporation."
"Bo_moon Kim is no longer with Atmel Corporation."
"Min_su Kim is no longer with Atmel Corporation."

Removing these email addresses that don't reach the addressees anymore.

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---
 MAINTAINERS | 5 -
 1 file changed, 5 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index fe8ac28..88a898e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11080,12 +11080,7 @@ S: Odd Fixes
 F: drivers/staging/vt665?/
 
 STAGING - WILC1000 WIFI DRIVER
-M: Johnny Kim <johnny@atmel.com>
-M: Austin Shin <austin.s...@atmel.com>
-M: Chris Park <chris.p...@atmel.com>
-M: Tony Cho <tony@atmel.com>
 M: Glen Lee <glen@atmel.com>
-M: Leo Kim <leo@atmel.com>
 L: linux-wireless@vger.kernel.org
 S: Supported
 F: drivers/staging/wilc1000/
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/2] staging: wilc1000: fix error handling in wilc_debugfs_init()

2016-06-25 Thread Luis de Bethencourt
On 25/06/16 22:36, Greg KH wrote:
> On Thu, Jun 23, 2016 at 01:36:17PM +0100, Luis de Bethencourt wrote:
>> The common format to check if a function returned an error pointer is to
>> use PTR_ERR(). Instead of ERR_PTR() which is used to return said errors.
>>
>> Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
>> Reviewed-by: Julian Calaby <julian.cal...@gmail.com>
>> ---
>>  drivers/staging/wilc1000/wilc_debugfs.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
>> b/drivers/staging/wilc1000/wilc_debugfs.c
>> index fcbc95d..48797dc 100644
>> --- a/drivers/staging/wilc1000/wilc_debugfs.c
>> +++ b/drivers/staging/wilc1000/wilc_debugfs.c
>> @@ -107,7 +107,7 @@ static int __init wilc_debugfs_init(void)
>>  struct wilc_debugfs_info_t *info;
>>  
>>  wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
>> -if (wilc_dir ==  ERR_PTR(-ENODEV)) {
>> +if (PTR_ERR(wilc_dir) == -ENODEV) {
>>  /* it's not error. the debugfs is just not being enabled. */
>>  printk("ERR, kernel has built without debugfs support\n");
>>  return 0;
> 
> No, the best way to do this is to just ignore the return value, you
> don't care about it.  It can be passed back into any debugfs calls just
> fine.
> 
> So don't check the value and all is good, debugfs was written in a way
> to make it _easy_ to use, no need for fancy error checking at all with
> it.
> 
> thanks,
> 
> greg k-h
> 

Thanks for the review Greg.

Just to make sure. You are proposing I just drop the 3 if checks? [0]

If that's what you mean I will send a patch as soon as you confirm :)

Happy hacking,
Luis



[0] Making the function look like this:
static int __init wilc_debugfs_init(void)
{
int i;

struct dentry *debugfs_files;
struct wilc_debugfs_info_t *info;

wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
for (i = 0; i < ARRAY_SIZE(debugfs_info); i++) {
info = _info[i];
debugfs_files = debugfs_create_file(info->name,
info->perm,
wilc_dir,
>data,
>fops);
}
return 0;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] staging: wilc1000: arrays can't be NULL

2016-06-23 Thread Luis de Bethencourt
On 24/06/16 00:54, Julian Calaby wrote:
> Hi Luis,
> 
> On Fri, Jun 24, 2016 at 9:50 AM, Luis de Bethencourt
> <lui...@osg.samsung.com> wrote:
>> On 24/06/16 00:15, Julian Calaby wrote:
>>> Hi Joe,
>>>
>>> On Fri, Jun 24, 2016 at 5:24 AM, Joe Perches <j...@perches.com> wrote:
>>>> On Thu, 2016-06-23 at 18:57 +0100, Luis de Bethencourt wrote:
>>>>> hif_drv->usr_scan_req.net.net_info[i] contains found_net_info structs
>>>>> which have the following element:
>>>>> u8 bssid[6];
>>>> []
>>>>> I am aware this patch gives a few checkpatch.pl warnings about lines being
>>>>> over 80 characters. Fixing that would be a completely different issue, and
>>>>> a lengthy one since the file has loads of them.
>>>>>
>>>>> Hopefully somebody else picks that up. Maybe I should send a hit to the
>>>>> kernelnewbies mailing list :)
>>>>
>>>> Or not.
>>>>
>>>> really_long_identifiers™ makes using 80 columns silly.
>>>>
>>>> The hungarian could probably be converted though.
>>>
>>> The main developers of this driver are slowly working through the
>>> driver's style issues, which is part of the reason why it's in
>>> staging.
>>>
>>> Thanks,
>>>
>>
>> I understand Julian,
>>
>> All the maintainers listed in the MAINTAINERS file are in CC. I will wait for
>> them to OK the suggestion of sending a patch fixing the Hungarian Notation.
> 
> I was letting you know that this work is going to happen, not
> dissuading you from doing it.
> 
>> Didn't mean to step on your toes. I just wanted to help.
> 
> No toes were stepped on. As I said, this was not a "don't do that"
> message, this was an "it's going to happen eventually" message.
> 
>> Code in staging is cared for by a lot of people :)
> 
> Indeed it is.
> 
> Thanks,
> 

Gotcha.

I will send the Hungarian Notation change tomorrow. Since it is some small help.

I will let the memcpy/memcp to ether_addr_* change for the maintainers. I 
believe
it will happen soon.

Thanks for your input.

Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] staging: wilc1000: arrays can't be NULL

2016-06-23 Thread Luis de Bethencourt
On 24/06/16 00:15, Julian Calaby wrote:
> Hi Joe,
> 
> On Fri, Jun 24, 2016 at 5:24 AM, Joe Perches <j...@perches.com> wrote:
>> On Thu, 2016-06-23 at 18:57 +0100, Luis de Bethencourt wrote:
>>> hif_drv->usr_scan_req.net.net_info[i] contains found_net_info structs
>>> which have the following element:
>>> u8 bssid[6];
>> []
>>> I am aware this patch gives a few checkpatch.pl warnings about lines being
>>> over 80 characters. Fixing that would be a completely different issue, and
>>> a lengthy one since the file has loads of them.
>>>
>>> Hopefully somebody else picks that up. Maybe I should send a hit to the
>>> kernelnewbies mailing list :)
>>
>> Or not.
>>
>> really_long_identifiers™ makes using 80 columns silly.
>>
>> The hungarian could probably be converted though.
> 
> The main developers of this driver are slowly working through the
> driver's style issues, which is part of the reason why it's in
> staging.
> 
> Thanks,
> 

I understand Julian,

All the maintainers listed in the MAINTAINERS file are in CC. I will wait for
them to OK the suggestion of sending a patch fixing the Hungarian Notation.

Didn't mean to step on your toes. I just wanted to help.

Code in staging is cared for by a lot of people :)

Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] staging: wilc1000: arrays can't be NULL

2016-06-23 Thread Luis de Bethencourt
On 23/06/16 20:24, Joe Perches wrote:
> On Thu, 2016-06-23 at 18:57 +0100, Luis de Bethencourt wrote:
>> hif_drv->usr_scan_req.net.net_info[i] contains found_net_info structs
>> which have the following element:
>> u8 bssid[6];
> []
>> I am aware this patch gives a few checkpatch.pl warnings about lines being
>> over 80 characters. Fixing that would be a completely different issue, and
>> a lengthy one since the file has loads of them.
>>
>> Hopefully somebody else picks that up. Maybe I should send a hit to the
>> kernelnewbies mailing list :)
> 
> Or not.
> 
> really_long_identifiers™ makes using 80 columns silly.

I agree. Not a priority, at all.

> 
> The hungarian could probably be converted though.
> 

I could look into this tomorrow.

I noticed, for example these 3 in the same function:
struct wid strWIDList[8];
u32 u32WidsCount = 0, dummyval = 0;
u8 *pu8CurrByte = NULL;

Not pretty and cleaning those should take little time.

> A log of the memcpy and memcpy uses could probably be
> converted to ether_addr_ too.
> 

Switching memcpy for ether_addr_copy and memcmp for ether_addr_equal.

I could send a patch for this as well, but I would need to have somebody
test it for me. Or maybe get this hardware for myself and do it properly.

Do you approve of my original patch?

Thanks for the review :)
Luis


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] staging: wilc1000: arrays can't be NULL

2016-06-23 Thread Luis de Bethencourt
hif_drv->usr_scan_req.net.net_info[i] contains found_net_info structs
which have the following element:
u8 bssid[6];

pstrNetworkInfo, of type network_info, also contains an u8 array named
bssid.

request->ssids is an array of cfg80211_ssid structs. Making ssid:
u8 ssid[IEEE80211_MAX_SSID_LEN];

In these 3 cases the arrays are being checked against NULL, which can't
happen. Removing the checks since they will always be true.

Found with smatch:
drivers/staging/wilc1000/host_interface.c:1234 Handle_RcvdNtwrkInfo() warn: 
this array is probably non-NULL. 'hif_drv->usr_scan_req.net_info[i].bssid'
drivers/staging/wilc1000/host_interface.c:1235 Handle_RcvdNtwrkInfo() warn: 
this array is probably non-NULL. 'pstrNetworkInfo->bssid'
drivers/staging/wilc1000/host_interface.c:1253 Handle_RcvdNtwrkInfo() warn: 
this array is probably non-NULL. 
'hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].bssid'
drivers/staging/wilc1000/host_interface.c:1254 Handle_RcvdNtwrkInfo() warn: 
this array is probably non-NULL. 'pstrNetworkInfo->bssid'

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---
Hi,

I am aware this patch gives a few checkpatch.pl warnings about lines being
over 80 characters. Fixing that would be a completely different issue, and
a lengthy one since the file has loads of them.

Hopefully somebody else picks that up. Maybe I should send a hit to the
kernelnewbies mailing list :)

Thanks,
Luis


 drivers/staging/wilc1000/host_interface.c | 38 ++-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  3 +-
 2 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 9535842..7d5745a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1231,17 +1231,14 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
}
 
for (i = 0; i < hif_drv->usr_scan_req.rcvd_ch_cnt; i++) {
-   if ((hif_drv->usr_scan_req.net_info[i].bssid) &&
-   (pstrNetworkInfo->bssid)) {
-   if 
(memcmp(hif_drv->usr_scan_req.net_info[i].bssid,
-  pstrNetworkInfo->bssid, 6) == 0) {
-   if (pstrNetworkInfo->rssi <= 
hif_drv->usr_scan_req.net_info[i].rssi) {
-   goto done;
-   } else {
-   
hif_drv->usr_scan_req.net_info[i].rssi = pstrNetworkInfo->rssi;
-   bNewNtwrkFound = false;
-   break;
-   }
+   if (memcmp(hif_drv->usr_scan_req.net_info[i].bssid,
+  pstrNetworkInfo->bssid, 6) == 0) {
+   if (pstrNetworkInfo->rssi <= 
hif_drv->usr_scan_req.net_info[i].rssi) {
+   goto done;
+   } else {
+   hif_drv->usr_scan_req.net_info[i].rssi 
= pstrNetworkInfo->rssi;
+   bNewNtwrkFound = false;
+   break;
}
}
}
@@ -1250,20 +1247,17 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
if (hif_drv->usr_scan_req.rcvd_ch_cnt < 
MAX_NUM_SCANNED_NETWORKS) {

hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].rssi = 
pstrNetworkInfo->rssi;
 
-   if 
(hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].bssid &&
-   pstrNetworkInfo->bssid) {
-   
memcpy(hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].bssid,
-  pstrNetworkInfo->bssid, 6);
+   
memcpy(hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].bssid,
+  pstrNetworkInfo->bssid, 6);
 
-   hif_drv->usr_scan_req.rcvd_ch_cnt++;
+   hif_drv->usr_scan_req.rcvd_ch_cnt++;
 
-   pstrNetworkInfo->new_network = true;
-   pJoinParams = 
host_int_ParseJoinBssParam(pstrNetworkInfo);
+   pstrNetworkInfo->new_network = true;
+   pJoinParams = 
host_int_Par

[PATCH v2 2/2] staging: wilc1000: fix error values in wilc_debugfs_init()

2016-06-23 Thread Luis de Bethencourt
If there was an error, returning -EINVAL is more appropriate than -1.

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
Reviewed-by: Julian Calaby <julian.cal...@gmail.com>
---
 drivers/staging/wilc1000/wilc_debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index 48797dc..6252931 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -115,7 +115,7 @@ static int __init wilc_debugfs_init(void)
 
if (!wilc_dir) {
printk("ERR, debugfs create dir\n");
-   return -1;
+   return -EINVAL;
}
 
for (i = 0; i < ARRAY_SIZE(debugfs_info); i++) {
@@ -129,7 +129,7 @@ static int __init wilc_debugfs_init(void)
if (!debugfs_files) {
printk("ERR fail to create the debugfs file, %s\n", 
info->name);
debugfs_remove_recursive(wilc_dir);
-   return -1;
+   return -EINVAL;
}
}
return 0;
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/2] staging: wilc1000: fix error handling in wilc_debugfs_init()

2016-06-23 Thread Luis de Bethencourt
The common format to check if a function returned an error pointer is to
use PTR_ERR(). Instead of ERR_PTR() which is used to return said errors.

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
Reviewed-by: Julian Calaby <julian.cal...@gmail.com>
---
 drivers/staging/wilc1000/wilc_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index fcbc95d..48797dc 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -107,7 +107,7 @@ static int __init wilc_debugfs_init(void)
struct wilc_debugfs_info_t *info;
 
wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
-   if (wilc_dir ==  ERR_PTR(-ENODEV)) {
+   if (PTR_ERR(wilc_dir) == -ENODEV) {
/* it's not error. the debugfs is just not being enabled. */
printk("ERR, kernel has built without debugfs support\n");
return 0;
-- 
2.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] staging: wilc1000: fix error handling in wilc_debugfs_init()

2016-06-23 Thread Luis de Bethencourt
On 23/06/16 02:29, Julian Calaby wrote:
> Hi All,
> 
> On Wed, Jun 22, 2016 at 10:39 PM, Luis de Bethencourt
> <lui...@osg.samsung.com> wrote:
>> The common format to check if a function returned an error pointer is to
>> use PTR_ERR(). Instead of ERR_PTR() which is used to return said errors.
>>
>> Also, if there was an error returning -EINVAL instead of -1 is more
>> appropriate.
> 
> These two changes could be argued to be separate changes deserving of
> their own patches.
> 
>> Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
> 
> However if everyone else is ok with that, this is:
> 
> Reviewed-by: Julian Calaby <julian.cal...@gmail.com>
> 
> Thanks,
> 

Hi Julian,

If you don't mind I will resend as two separate patches and include your
Reviewed-by in both.

Thanks for the review,
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] staging: wilc1000: fix error handling in wilc_debugfs_init()

2016-06-22 Thread Luis de Bethencourt
The common format to check if a function returned an error pointer is to
use PTR_ERR(). Instead of ERR_PTR() which is used to return said errors.

Also, if there was an error returning -EINVAL instead of -1 is more
appropriate.

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---
 drivers/staging/wilc1000/wilc_debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_debugfs.c 
b/drivers/staging/wilc1000/wilc_debugfs.c
index fcbc95d..6252931 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -107,7 +107,7 @@ static int __init wilc_debugfs_init(void)
struct wilc_debugfs_info_t *info;
 
wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
-   if (wilc_dir ==  ERR_PTR(-ENODEV)) {
+   if (PTR_ERR(wilc_dir) == -ENODEV) {
/* it's not error. the debugfs is just not being enabled. */
printk("ERR, kernel has built without debugfs support\n");
return 0;
@@ -115,7 +115,7 @@ static int __init wilc_debugfs_init(void)
 
if (!wilc_dir) {
printk("ERR, debugfs create dir\n");
-   return -1;
+   return -EINVAL;
}
 
for (i = 0; i < ARRAY_SIZE(debugfs_info); i++) {
@@ -129,7 +129,7 @@ static int __init wilc_debugfs_init(void)
if (!debugfs_files) {
printk("ERR fail to create the debugfs file, %s\n", 
info->name);
debugfs_remove_recursive(wilc_dir);
-   return -1;
+   return -EINVAL;
}
}
return 0;
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] rtl8xxxu: remove unneeded assignments

2016-06-10 Thread Luis de Bethencourt
reg_eac and reg_ecc are only used if candidate is bigger than 0, and in
that case new values will be given to them. Removing the unused
assignments.

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
index fe19ace..984af46 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
@@ -1249,11 +1249,9 @@ static void rtl8192eu_phy_iq_calibrate(struct 
rtl8xxxu_priv *priv)
reg_e94 = result[i][0];
reg_e9c = result[i][1];
reg_ea4 = result[i][2];
-   reg_eac = result[i][3];
reg_eb4 = result[i][4];
reg_ebc = result[i][5];
reg_ec4 = result[i][6];
-   reg_ecc = result[i][7];
}
 
if (candidate >= 0) {
-- 
2.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mac80211: fix order of flag descriptions

2016-03-19 Thread Luis de Bethencourt
On 18/03/16 17:46, Joe Perches wrote:
> On Fri, 2016-03-18 at 17:40 +0000, Luis de Bethencourt wrote:
>> On 18/03/16 17:29, Joe Perches wrote:
>>> On Fri, 2016-03-18 at 16:35 +, Luis de Bethencourt wrote:
>>>> Fix order of mac80211_rx_flags description to match the enum.
> []
>>>> I want ahead and fixed the order of the descriptions. checkpatch.pl was 
>>>> giving
>>>> a warning to my previous patch and I had a hunch it was because the wrong 
>>>> order
>>>> breaks the parser. Indeed it does and with this patch below checkpatch.pl 
>>>> does
>>>> not complain about this flag descriptions anymore.
>>> checkpatch complains?  About what?
>> warning: Enum value 'RX_FLAG_DUP_VALIDATED' not described in enum 
>> 'mac80211_rx_flags'
> 
> That's not a checkpatch warning.
> 
> cheers, Joe
> 

Oh no!

Joe is right. That isn't a checkpatch warning, but checkpatch just printing the 
line
in my commit message that goes over 75 characters. Which I kept that big to 
keep the
format from make htmldocs.

I still think the order of the documentation should match the enum regardless, 
it is
nicer for developers reading the code.

Sorry :( my bad for misinterpreting checkpatch's output.

Thanks you Joe for correcting me,
Luis 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mac80211: add doc for RX_FLAG_DUP_VALIDATED flag

2016-03-19 Thread Luis de Bethencourt
On 18/03/16 16:09, Luis de Bethencourt wrote:
> Add documentation for the flag for duplication check.
> 
> Fixes the following warning when running make htmldocs:
> warning: Enum value 'RX_FLAG_DUP_VALIDATED' not described in enum 
> 'mac80211_rx_flags'
> 
> Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
> ---
> Hi,
> 
> While running make htmldocs I noticed a warning about RX_FLAG_DUP_VALIDATED
> missing a description. This patch fixes this.
> 
> I have noticed the order of the descriptions of the mac80211_rx_flags doesn't
> match the order in the enum. I am happy to fix this if it would be of 
> interest.
> 
> Thanks,
> Luis
> 
>  include/net/mac80211.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index a5c..42c8cde 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -1001,6 +1001,8 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info 
> *info)
>   *   flag indicates that the PN was verified for replay protection.
>   *   Note that this flag is also currently only supported when a frame
>   *   is also decrypted (ie. @RX_FLAG_DECRYPTED must be set)
> + * @RX_FLAG_DUP_VALIDATED: Set this flag for the driver to check for packet
> + *   duplication by itself.
>   * @RX_FLAG_FAILED_FCS_CRC: Set this flag if the FCS check failed on
>   *   the frame.
>   * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
> 

Please ignore the second patch I replied to this one. It is wrong due to my
misunderstanding.

This above patch adding RX_FLAG_DUP_VALIDATED is correct and I believe it to be
valid.

Thanks for the reviews,
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mac80211: fix order of flag descriptions

2016-03-19 Thread Luis de Bethencourt
On 18/03/16 16:49, Johannes Berg wrote:
> On Fri, 2016-03-18 at 16:35 +0000, Luis de Bethencourt wrote:
>> Fix order of mac80211_rx_flags description to match the enum.
>>
>> Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
>> ---
>> Hi,
>>
>> I want ahead and fixed the order of the descriptions. checkpatch.pl
>> was giving
>> a warning to my previous patch and I had a hunch it was because the
>> wrong order
>> breaks the parser. Indeed it does and with this patch below
>> checkpatch.pl does
>> not complain about this flag descriptions anymore.
>>
> Huh. I think we should fix checkpatch.pl instead. While the current
> order isn't likely really good, I believe kernel-doc will output the
> documentation in the order it's listed, and that can be useful for the
> documentation output to group related things, even if their bits may be
> further apart.
> 
> johannes
> 

I agree checkpatch.pl should be fixed. I can look into it. No promises
though, it has been a long time since I look at Perl code.

I understand the logic of grouping the documentation in logical blocks.
It is unfortunate though that this means the enum and documentation won't
match, which makes reading the code harder.

In this particular case I don't see the order of the documentation broken
because flags are being grouped.

Thanks for the review :)
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mac80211: fix order of flag descriptions

2016-03-19 Thread Luis de Bethencourt
On 18/03/16 17:29, Joe Perches wrote:
> On Fri, 2016-03-18 at 16:35 +0000, Luis de Bethencourt wrote:
>> Fix order of mac80211_rx_flags description to match the enum.
>>
>> Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
>> ---
>> Hi,
>>
>> I want ahead and fixed the order of the descriptions. checkpatch.pl was 
>> giving
>> a warning to my previous patch and I had a hunch it was because the wrong 
>> order
>> breaks the parser. Indeed it does and with this patch below checkpatch.pl 
>> does
>> not complain about this flag descriptions anymore.
> 
> checkpatch complains?  About what?
> 

warning: Enum value 'RX_FLAG_DUP_VALIDATED' not described in enum 
'mac80211_rx_flags'

Is the warning checkpatch.pl gives against my first patch (add doc for
RX_FLAG_DUP_VALIDATED flag). This is silenced by reordering the descriptions to 
match
the order in the enum.

Thanks,
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mac80211: add doc for RX_FLAG_DUP_VALIDATED flag

2016-03-19 Thread Luis de Bethencourt
Add documentation for the flag for duplication check.

Fixes the following warning when running make htmldocs:
warning: Enum value 'RX_FLAG_DUP_VALIDATED' not described in enum 
'mac80211_rx_flags'

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---
Hi,

While running make htmldocs I noticed a warning about RX_FLAG_DUP_VALIDATED
missing a description. This patch fixes this.

I have noticed the order of the descriptions of the mac80211_rx_flags doesn't
match the order in the enum. I am happy to fix this if it would be of interest.

Thanks,
Luis

 include/net/mac80211.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index a5c..42c8cde 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1001,6 +1001,8 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info 
*info)
  * flag indicates that the PN was verified for replay protection.
  * Note that this flag is also currently only supported when a frame
  * is also decrypted (ie. @RX_FLAG_DECRYPTED must be set)
+ * @RX_FLAG_DUP_VALIDATED: Set this flag for the driver to check for packet
+ * duplication by itself.
  * @RX_FLAG_FAILED_FCS_CRC: Set this flag if the FCS check failed on
  * the frame.
  * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mac80211: fix order of flag descriptions

2016-03-19 Thread Luis de Bethencourt
Fix order of mac80211_rx_flags description to match the enum.

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---
Hi,

I want ahead and fixed the order of the descriptions. checkpatch.pl was giving
a warning to my previous patch and I had a hunch it was because the wrong order
breaks the parser. Indeed it does and with this patch below checkpatch.pl does
not complain about this flag descriptions anymore.

Thanks,
Luis

 include/net/mac80211.h | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 42c8cde..4b215a3 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -992,17 +992,13 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info 
*info)
  * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame.
  * Use together with %RX_FLAG_MMIC_STRIPPED.
  * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware.
+ * @RX_FLAG_MACTIME_PLCP_START: The timestamp passed in the RX status (@mactime
+ * field) is valid and contains the time the SYNC preamble was received.
  * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame,
  * verification has been done by the hardware.
  * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame.
  * If this flag is set, the stack cannot do any replay detection
  * hence the driver or hardware will have to do that.
- * @RX_FLAG_PN_VALIDATED: Currently only valid for CCMP/GCMP frames, this
- * flag indicates that the PN was verified for replay protection.
- * Note that this flag is also currently only supported when a frame
- * is also decrypted (ie. @RX_FLAG_DECRYPTED must be set)
- * @RX_FLAG_DUP_VALIDATED: Set this flag for the driver to check for packet
- * duplication by itself.
  * @RX_FLAG_FAILED_FCS_CRC: Set this flag if the FCS check failed on
  * the frame.
  * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
@@ -1011,14 +1007,8 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info 
*info)
  * field) is valid and contains the time the first symbol of the MPDU
  * was received. This is useful in monitor mode and for proper IBSS
  * merging.
- * @RX_FLAG_MACTIME_END: The timestamp passed in the RX status (@mactime
- * field) is valid and contains the time the last symbol of the MPDU
- * (including FCS) was received.
- * @RX_FLAG_MACTIME_PLCP_START: The timestamp passed in the RX status (@mactime
- * field) is valid and contains the time the SYNC preamble was received.
  * @RX_FLAG_SHORTPRE: Short preamble was used for this frame
  * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index
- * @RX_FLAG_VHT: VHT MCS was used and rate_index is MCS index
  * @RX_FLAG_40MHZ: HT40 (40 MHz) was used
  * @RX_FLAG_SHORT_GI: Short guard interval was used
  * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present.
@@ -1029,6 +1019,12 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info 
*info)
  * @RX_FLAG_AMPDU_DETAILS: A-MPDU details are known, in particular the 
reference
  * number (@ampdu_reference) must be populated and be a distinct number for
  * each A-MPDU
+ * @RX_FLAG_PN_VALIDATED: Currently only valid for CCMP/GCMP frames, this
+ * flag indicates that the PN was verified for replay protection.
+ * Note that this flag is also currently only supported when a frame
+ * is also decrypted (ie. @RX_FLAG_DECRYPTED must be set)
+ * @RX_FLAG_DUP_VALIDATED: Set this flag for the driver to check for packet
+ * duplication by itself.
  * @RX_FLAG_AMPDU_LAST_KNOWN: last subframe is known, should be set on all
  * subframes of a single A-MPDU
  * @RX_FLAG_AMPDU_IS_LAST: this subframe is the last subframe of the A-MPDU
@@ -1036,8 +1032,10 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info 
*info)
  * on this subframe
  * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
  * is stored in the @ampdu_delimiter_crc field)
- * @RX_FLAG_MIC_STRIPPED: The mic was stripped of this packet. Decryption was
- * done by the hardware
+ * @RX_FLAG_MACTIME_END: The timestamp passed in the RX status (@mactime
+ * field) is valid and contains the time the last symbol of the MPDU
+ * (including FCS) was received.
+ * @RX_FLAG_VHT: VHT MCS was used and rate_index is MCS index
  * @RX_FLAG_LDPC: LDPC was used
  * @RX_FLAG_ONLY_MONITOR: Report frame only to monitor interfaces without
  * processing it in any regular way.
@@ -1062,6 +1060,8 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info 
*info)
  * @RX_FLAG_RADIOTAP_VENDOR_DATA: This frame contains vendor-specific
  * radiotap data in the skb->data (before the frame) as described by
  * the  ieee80211_vendor_radiotap.
+ * @RX_FLAG_MIC_STRIPPED: The mic was stripped of this packet. Decryption was
+ * done by the hardware
  */
 enum mac80211_rx_flags {
RX_FLAG_M

Re: [PATCH] mac80211: fix order of flag descriptions

2016-03-19 Thread Luis de Bethencourt
On 18/03/16 17:46, Luis de Bethencourt wrote:
> On 18/03/16 16:49, Johannes Berg wrote:
>> On Fri, 2016-03-18 at 16:35 +0000, Luis de Bethencourt wrote:
>>> Fix order of mac80211_rx_flags description to match the enum.
>>>
>>> Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
>>> ---
>>> Hi,
>>>
>>> I want ahead and fixed the order of the descriptions. checkpatch.pl
>>> was giving
>>> a warning to my previous patch and I had a hunch it was because the
>>> wrong order
>>> breaks the parser. Indeed it does and with this patch below
>>> checkpatch.pl does
>>> not complain about this flag descriptions anymore.
>>>
>> Huh. I think we should fix checkpatch.pl instead. While the current
>> order isn't likely really good, I believe kernel-doc will output the
>> documentation in the order it's listed, and that can be useful for the
>> documentation output to group related things, even if their bits may be
>> further apart.
>>
>> johannes
>>
> 
> I agree checkpatch.pl should be fixed. I can look into it. No promises
> though, it has been a long time since I look at Perl code.
> 
> I understand the logic of grouping the documentation in logical blocks.
> It is unfortunate though that this means the enum and documentation won't
> match, which makes reading the code harder.
> 
> In this particular case I don't see the order of the documentation broken
> because flags are being grouped.
> 
> Thanks for the review :)
> Luis
> 

Sorry Johannes,

Update. checkpatch doesn't need fixing and it does see the documentation
independently of the order. It was my mistake.

Joe Perches pointed it out in this email branch:
https://lkml.org/lkml/2016/3/18/532


Thanks for looking into this, sorry for my blunder.
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RESEND PATCH] staging: wilc1000: return -ENOMEM when kmalloc failed

2015-10-25 Thread Luis de Bethencourt
The driver is using -1 instead of the -ENOMEM defined macro to specify that
a buffer allocation failed.

Fixes smatch warning and similars:
drivers/staging/wilc1000/host_interface.c:1757 Handle_Key() warn:
returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---

Hi,

Resending because previous version didn't apply against staging-next due to the
recent changes on this file. Refreshed.

Thanks,
Luis

 drivers/staging/wilc1000/host_interface.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 5f81eab..064e34c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1754,7 +1754,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
 
if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send Key\n");
-   return -1;
+   return -ENOMEM;
}
 
kfree(pstrHostIFkeyAttr->attr.wep.key);
@@ -1776,7 +1776,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len 
+ 2, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send Key\n");
-   return -1;
+   return -ENOMEM;
}
pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
memcpy(pu8keybuf + 1, 
>attr.wep.key_len, 1);
@@ -1823,7 +1823,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send RxGTK Key\n");
-   ret = -1;
+   ret = -ENOMEM;
goto _WPARxGtk_end_case_;
}
 
@@ -1858,7 +1858,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send RxGTK Key\n");
-   ret = -1;
+   ret = -ENOMEM;
goto _WPARxGtk_end_case_;
}
 
@@ -1887,7 +1887,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
 _WPARxGtk_end_case_:
kfree(pstrHostIFkeyAttr->attr.wpa.key);
kfree(pstrHostIFkeyAttr->attr.wpa.seq);
-   if (ret == -1)
+   if (ret)
return ret;
 
break;
@@ -1899,7 +1899,7 @@ _WPARxGtk_end_case_:
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send PTK Key\n");
-   ret = -1;
+   ret = -ENOMEM;
goto _WPAPtk_end_case_;
 
}
@@ -1931,7 +1931,7 @@ _WPARxGtk_end_case_:
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send PTK Key\n");
-   ret = -1;
+   ret = -ENOMEM;
goto _WPAPtk_end_case_;
 
}
@@ -1954,7 +1954,7 @@ _WPARxGtk_end_case_:
 
 _WPAPtk_end_case_:
kfree(pstrHostIFkeyAttr->attr.wpa.key);
-   if (ret == -1)
+   if (ret)
return ret;
 
break;
@@ -1967,7 +1967,7 @@ _WPAPtk_end_case_:
pu8keybuf = kmalloc((pstrHostIFkeyAttr->attr.pmkid.numpmkid * 
PMKSA_KEY_LEN) + 1, GFP_KERNEL);
if (!pu8keybuf) {
PRINT_ER("No buffer to send PMKSA Key\n");
-   return -1;
+   return -ENOMEM;
}
 
pu8keybuf[0] = pstrHostIFkeyAttr->attr.pmkid.numpmkid;
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] staging: rtl8723au: core: rtw_wlan_util: fix misleading indentation

2015-10-21 Thread Luis de Bethencourt
For loop is outside of the else branch of the above conditional statement.
Fixing misleading indentation.

Fix a smatch warning:
drivers/staging/rtl8723au/core/rtw_wlan_util.c:528
WMMOnAssocRsp23a() warn: curly braces intended?

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---
 drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
index 5e87360..cc2b84b 100644
--- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
@@ -525,7 +525,7 @@ void WMMOnAssocRsp23a(struct rtw_adapter *padapter)
else
aSifsTime = 16;
 
-   for (i = 0; i < 4; i++) {
+   for (i = 0; i < 4; i++) {
ACI = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN >> 5) & 0x03;
ACM = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN >> 4) & 0x01;
 
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] staging: wilc1000: return -ENOMEM when kmalloc failed

2015-10-21 Thread Luis de Bethencourt
The driver is using -1 instead of the -ENOMEM defined macro to specify that
a buffer allocation failed.

Fixes smatch warning and similars:
drivers/staging/wilc1000/host_interface.c:1782 Handle_Key() warn:
returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---
 drivers/staging/wilc1000/host_interface.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 38fead4..ec47a28 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1756,7 +1756,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
 
if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send Key\n");
-   return -1;
+   return -ENOMEM;
}
 
kfree(pstrHostIFkeyAttr->attr.wep.key);
@@ -1779,7 +1779,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len 
+ 2, GFP_KERNEL);
if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send Key\n");
-   return -1;
+   return -ENOMEM;
}
pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
memcpy(pu8keybuf + 1, 
>attr.wep.key_len, 1);
@@ -1826,7 +1826,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send RxGTK Key\n");
-   ret = -1;
+   ret = -ENOMEM;
goto _WPARxGtk_end_case_;
}
 
@@ -1861,7 +1861,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send RxGTK Key\n");
-   ret = -1;
+   ret = -ENOMEM;
goto _WPARxGtk_end_case_;
}
 
@@ -1890,7 +1890,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
 _WPARxGtk_end_case_:
kfree(pstrHostIFkeyAttr->attr.wpa.key);
kfree(pstrHostIFkeyAttr->attr.wpa.seq);
-   if (ret == -1)
+   if (ret)
return ret;
 
break;
@@ -1905,7 +1905,7 @@ _WPARxGtk_end_case_:
 
if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send PTK Key\n");
-   ret = -1;
+   ret = -ENOMEM;
goto _WPAPtk_end_case_;
 
}
@@ -1940,7 +1940,7 @@ _WPARxGtk_end_case_:
 
if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send PTK Key\n");
-   ret = -1;
+   ret = -ENOMEM;
goto _WPAPtk_end_case_;
 
}
@@ -1963,7 +1963,7 @@ _WPARxGtk_end_case_:
 
 _WPAPtk_end_case_:
kfree(pstrHostIFkeyAttr->attr.wpa.key);
-   if (ret == -1)
+   if (ret)
return ret;
 
break;
@@ -1976,7 +1976,7 @@ _WPAPtk_end_case_:
pu8keybuf = kmalloc((pstrHostIFkeyAttr->attr.pmkid.numpmkid * 
PMKSA_KEY_LEN) + 1, GFP_KERNEL);
if (pu8keybuf == NULL) {
PRINT_ER("No buffer to send PMKSA Key\n");
-   return -1;
+   return -ENOMEM;
}
 
pu8keybuf[0] = pstrHostIFkeyAttr->attr.pmkid.numpmkid;
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] staging: wilc1000: Remove boolean comparisons

2015-10-16 Thread Luis de Bethencourt
Boolean tests do not need explicit comparison to true or false.

Signed-off-by: Luis de Bethencourt <lui...@osg.samsung.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 706912b..16a2a5f 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -363,7 +363,7 @@ static void CfgScanResult(enum scan_event enuScanEvent, 
tstrNetworkInfo *pstrNet
struct cfg80211_bss *bss = NULL;
 
priv = (struct wilc_priv *)pUserVoid;
-   if (priv->bCfgScanning == true) {
+   if (priv->bCfgScanning) {
if (enuScanEvent == SCAN_EVENT_NETWORK_FOUND) {
wiphy = priv->dev->ieee80211_ptr->wiphy;
 
@@ -391,7 +391,7 @@ static void CfgScanResult(enum scan_event enuScanEvent, 
tstrNetworkInfo *pstrNet
   "BeaconPeriod: %d\n", 
channel->center_freq, (((s32)pstrNetworkInfo->s8rssi) * 100),
   pstrNetworkInfo->u16CapInfo, 
pstrNetworkInfo->u16BeaconPeriod);
 
-   if (pstrNetworkInfo->bNewNetwork == true) {
+   if (pstrNetworkInfo->bNewNetwork) {
if (priv->u32RcvdChCount < 
MAX_NUM_SCANNED_NETWORKS) { /* TODO: mostafa: to be replaced by */
/*   max_scan_ssids 
*/
PRINT_D(CFG80211_DBG, "Network 
%s found\n", pstrNetworkInfo->au8ssid);
@@ -1947,7 +1947,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, 
u32 size)
if (ieee80211_is_action(buff[FRAME_TYPE_ID])) {
PRINT_D(GENERIC_DBG, "Rx Action Frame Type: %x %x\n", 
buff[ACTION_SUBTYPE_ID], buff[P2P_PUB_ACTION_SUBTYPE]);
 
-   if (priv->bCfgScanning == true && 
time_after_eq(jiffies, (unsigned long)pstrWFIDrv->u64P2p_MgmtTimeout)) {
+   if (priv->bCfgScanning && time_after_eq(jiffies, 
(unsigned long)pstrWFIDrv->u64P2p_MgmtTimeout)) {
PRINT_D(GENERIC_DBG, "Receiving action frames 
from wrong channels\n");
return;
}
@@ -2360,7 +2360,7 @@ static int mgmt_tx_cancel_wait(struct wiphy *wiphy,
PRINT_D(GENERIC_DBG, "Tx Cancel wait :%lu\n", jiffies);
pstrWFIDrv->u64P2p_MgmtTimeout = jiffies;
 
-   if (priv->bInP2PlistenState == false) {
+   if (!priv->bInP2PlistenState) {
cfg80211_remain_on_channel_expired(priv->wdev,
   
priv->strRemainOnChanParams.u64ListenCookie,
   
priv->strRemainOnChanParams.pstrListenChan,
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/4] staging: wilc1000: cover letter

2015-07-07 Thread Luis de Bethencourt
On Mon, Jul 06, 2015 at 07:22:09PM -0700, Greg Kroah-Hartman wrote:
 On Fri, Jun 26, 2015 at 04:43:44PM +0200, Luis de Bethencourt wrote:
  Patches to be applied on top of
  https://patchwork.kernel.org/patch/6655831/
 
 I don't use patchwork, and when on an airplane with no internet access
 (like right now), a url provides no context at all.  Always use email
 subject lines or something that I can actually reference properly while
 offline...
 
 thanks,
 
 greg k-h

OK. Sorry. Didn't knew this but noted for the future.

Thanks for the reviews and merges!
Luis
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] staging: wilc1000: remove whitespaces before quoted newlines

2015-06-26 Thread Luis de Bethencourt
Fix all checkpatch.pl warnings:
WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: Luis de Bethencourt l...@debethencourt.com
---
 drivers/staging/wilc1000/host_interface.c | 84 +++
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index e13074f..79b7c2a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -699,7 +699,7 @@ static s32 Handle_SetOperationMode(void *drvHandler, 
tstrHostIfSetOperationMode
strWID.s32ValueSize = sizeof(u32);
 
/*Sending Cfg*/
-   PRINT_INFO(HOSTINF_DBG, pstrWFIDrv= %p \n, pstrWFIDrv);
+   PRINT_INFO(HOSTINF_DBG, pstrWFIDrv= %p\n, pstrWFIDrv);
 
s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv);
 
@@ -740,7 +740,7 @@ s32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, 
u8 idx)
if (pu8IPAddr[0]  192)
pu8IPAddr[0] = 0;
 
-   PRINT_INFO(HOSTINF_DBG, Indx = %d, Handling set  IP = %d.%d.%d.%d \n, 
idx, pu8IPAddr[0], pu8IPAddr[1], pu8IPAddr[2], pu8IPAddr[3]);
+   PRINT_INFO(HOSTINF_DBG, Indx = %d, Handling set  IP = %d.%d.%d.%d\n, 
idx, pu8IPAddr[0], pu8IPAddr[1], pu8IPAddr[2], pu8IPAddr[3]);
 
WILC_memcpy(gs8SetIP[idx], pu8IPAddr, IP_ALEN);
 
@@ -810,7 +810,7 @@ s32 Handle_get_IPAddress(void *drvHandler, u8 *pu8IPAddr, 
u8 idx)
PRINT_ER(Failed to get IP address\n);
WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
} else {
-   PRINT_INFO(HOSTINF_DBG, IP address retrieved:: u8IfIdx = %d 
\n, idx);
+   PRINT_INFO(HOSTINF_DBG, IP address retrieved:: u8IfIdx = 
%d\n, idx);
PRINT_INFO(HOSTINF_DBG, %d.%d.%d.%d\n, gs8GetIP[idx][0], 
gs8GetIP[idx][1], gs8GetIP[idx][2], gs8GetIP[idx][3]);
PRINT_INFO(HOSTINF_DBG, \n);
}
@@ -1253,7 +1253,7 @@ static s32 Handle_Scan(void *drvHandler, 
tstrHostIFscanAttr *pstrHostIFscanAttr)
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
 
PRINT_D(HOSTINF_DBG, Setting SCAN params\n);
-   PRINT_D(HOSTINF_DBG, Scanning: In [%d] state \n, 
pstrWFIDrv-enuHostIFstate);
+   PRINT_D(HOSTINF_DBG, Scanning: In [%d] state\n, 
pstrWFIDrv-enuHostIFstate);
 
pstrWFIDrv-strWILC_UsrScanReq.pfUserScanResult = 
pstrHostIFscanAttr-pfScanResult;
pstrWFIDrv-strWILC_UsrScanReq.u32UserScanPvoid = 
pstrHostIFscanAttr-pvUserArg;
@@ -1524,7 +1524,7 @@ static s32 Handle_Connect(void *drvHandler, 
tstrHostIFconnectAttr *pstrHostIFcon
DeallocateSurveyResults(pstrSurveyResults);
} else {
WILC_ERRORREPORT(s32Error, WILC_FAIL);
-   PRINT_ER(ParseSurveyResults() Error(%d) \n, s32Err);
+   PRINT_ER(ParseSurveyResults() Error(%d)\n, s32Err);
}
 
 
@@ -1555,7 +1555,7 @@ static s32 Handle_Connect(void *drvHandler, 
tstrHostIFconnectAttr *pstrHostIFcon
if (i  pstrWFIDrv-u32SurveyResultsCount) {
u8bssDscListIndex = i;
 
-   PRINT_INFO(HOSTINF_DBG, Connecting to network of Bss Idx %d 
and SSID %s and channel %d \n,
+   PRINT_INFO(HOSTINF_DBG, Connecting to network of Bss Idx%d and 
SSID %s and channel%d\n,
   u8bssDscListIndex, 
pstrWFIDrv-astrSurveyResults[u8bssDscListIndex].SSID,
   
pstrWFIDrv-astrSurveyResults[u8bssDscListIndex].Channel);
 
@@ -2006,7 +2006,7 @@ static s32 Handle_Connect(void *drvHandler, 
tstrHostIFconnectAttr *pstrHostIFcon
}
 
} else {
-   PRINT_ER(Connect callback function pointer is NULL 
\n);
+   PRINT_ER(Connect callback function pointer is NULL\n);
}
}
 
@@ -2162,7 +2162,7 @@ static s32 Handle_ConnectTimeout(void *drvHandler)
strConnectInfo.pu8ReqIEs = NULL;
}
} else {
-   PRINT_ER(Connect callback function pointer is NULL \n);
+   PRINT_ER(Connect callback function pointer is NULL\n);
}
 
/* Here we will notify our firmware also with the Connection failure 
{through sending to it Cfg packet carrying
@@ -2301,7 +2301,7 @@ static s32 Handle_RcvdNtwrkInfo(void *drvHandler, 
tstrRcvdNetworkInfo *pstrRcvdN
 
}
} else {
-   PRINT_WRN(HOSTINF_DBG, Discovered networks 
exceeded max. limit \n);
+   PRINT_WRN(HOSTINF_DBG, Discovered networks 
exceeded max. limit\n);
}
} else {
pstrNetworkInfo-bNewNetwork = false;
@@ -2423,7 +2423,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, 
tstrRcvdGnrlAsyncInfo *pst
s32Err = 
ParseAssocRespInfo(gapu8RcvdAssocResp

[PATCH 1/4] staging: wilc1000: remove unnecessary braces

2015-06-26 Thread Luis de Bethencourt
Removing all checkpatch.pl warnings:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Luis de Bethencourt l...@debethencourt.com
---
 drivers/staging/wilc1000/host_interface.c | 276 ++
 1 file changed, 92 insertions(+), 184 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index d1fe73d..bf183b2 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -659,9 +659,8 @@ static s32 Handle_SetWfiDrvHandler(tstrHostIfSetDrvHandler 
*pstrHostIfSetDrvHand
s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv);
 
 
-   if ((pstrHostIfSetDrvHandler-u32Address) == (u32)NULL) {
+   if ((pstrHostIfSetDrvHandler-u32Address) == (u32)NULL)
up(hSemDeinitDrvHandle);
-   }
 
 
if (s32Error) {
@@ -705,9 +704,8 @@ static s32 Handle_SetOperationMode(void *drvHandler, 
tstrHostIfSetOperationMode
s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv);
 
 
-   if ((pstrHostIfSetOperationMode-u32Mode) == (u32)NULL) {
+   if ((pstrHostIfSetOperationMode-u32Mode) == (u32)NULL)
up(hSemDeinitDrvHandle);
-   }
 
 
if (s32Error) {
@@ -1204,10 +1202,9 @@ static s32 Handle_CfgParam(void *drvHandler, 
tstrHostIFCfgParamAttr *strHostIFCf
}
s32Error = SendConfigPkt(SET_CFG, strWIDList, u8WidCnt, false, 
(u32)pstrWFIDrv);
 
-   if (s32Error) {
+   if (s32Error)
PRINT_ER(Error in setting CFG params\n);
 
-   }
WILC_CATCH(s32Error)
{
}
@@ -1284,9 +1281,8 @@ static s32 Handle_Scan(void *drvHandler, 
tstrHostIFscanAttr *pstrHostIFscanAttr)
strWIDList[u32WidsCount].u16WIDid = (u16)WID_SSID_PROBE_REQ;
strWIDList[u32WidsCount].enuWIDtype = WID_STR;
 
-   for (i = 0; i  pstrHostIFscanAttr-strHiddenNetwork.u8ssidnum; i++) {
+   for (i = 0; i  pstrHostIFscanAttr-strHiddenNetwork.u8ssidnum; i++)
valuesize += 
((pstrHostIFscanAttr-strHiddenNetwork.pstrHiddenNetworkInfo[i].u8ssidlen) + 1);
-   }
pu8HdnNtwrksWidVal = WILC_MALLOC(valuesize + 1);
strWIDList[u32WidsCount].ps8WidVal = pu8HdnNtwrksWidVal;
if (strWIDList[u32WidsCount].ps8WidVal != NULL) {
@@ -1336,9 +1332,8 @@ static s32 Handle_Scan(void *drvHandler, 
tstrHostIFscanAttr *pstrHostIFscanAttr)
int i;
 
for (i = 0; i  pstrHostIFscanAttr-u8ChnlListLen; i++) {
-   if (pstrHostIFscanAttr-pu8ChnlFreqList[i]  0) {
+   if (pstrHostIFscanAttr-pu8ChnlFreqList[i]  0)
pstrHostIFscanAttr-pu8ChnlFreqList[i] = 
pstrHostIFscanAttr-pu8ChnlFreqList[i] - 1;
-   }
}
}
 
@@ -1400,9 +1395,8 @@ static s32 Handle_Scan(void *drvHandler, 
tstrHostIFscanAttr *pstrHostIFscanAttr)
pstrHostIFscanAttr-pu8ChnlFreqList = NULL;
}
 
-   if (pu8HdnNtwrksWidVal != NULL) {
+   if (pu8HdnNtwrksWidVal != NULL)
WILC_FREE(pu8HdnNtwrksWidVal);
-   }
 
return s32Error;
 }
@@ -1778,9 +1772,8 @@ static s32 Handle_Connect(void *drvHandler, 
tstrHostIFconnectAttr *pstrHostIFcon
strWIDList[u32WidsCount].s32ValueSize = MAX_SSID_LEN + 7;
strWIDList[u32WidsCount].ps8WidVal = 
WILC_MALLOC(strWIDList[u32WidsCount].s32ValueSize);
 
-   if (strWIDList[u32WidsCount].ps8WidVal == NULL) {
+   if (strWIDList[u32WidsCount].ps8WidVal == NULL)
WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
-   }
 
pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal;
 
@@ -1795,9 +1788,8 @@ static s32 Handle_Connect(void *drvHandler, 
tstrHostIFconnectAttr *pstrHostIFcon
PRINT_ER(Channel out of range\n);
*(pu8CurrByte++) = 0xFF;
}
-   if (pstrHostIFconnectAttr-pu8bssid != NULL) {
+   if (pstrHostIFconnectAttr-pu8bssid != NULL)
WILC_memcpy(pu8CurrByte, pstrHostIFconnectAttr-pu8bssid, 6);
-   }
pu8CurrByte += 6;
 
/* keep the buffer at the start of the allocated pointer to use it with 
the free*/
@@ -1817,9 +1809,8 @@ static s32 Handle_Connect(void *drvHandler, 
tstrHostIFconnectAttr *pstrHostIFcon
gu32FlushedJoinReqSize = strWIDList[u32WidsCount].s32ValueSize;
gu8FlushedJoinReq = WILC_MALLOC(gu32FlushedJoinReqSize);
}
-   if (strWIDList[u32WidsCount].ps8WidVal == NULL) {
+   if (strWIDList[u32WidsCount].ps8WidVal == NULL)
WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
-   }
 
pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal;
 
@@ -1845,15 +1836,13 @@ static s32 Handle_Connect(void *drvHandler, 
tstrHostIFconnectAttr *pstrHostIFcon
PRINT_D(HOSTINF_DBG, * Cap Info %0x*\n, (*(pu8CurrByte - 2) | 
((*(pu8CurrByte - 1))  8)));
 
/* sa

Re: [PATCH 3/4] staging: wilc1000: remove whitespaces before quoted newlines

2015-06-26 Thread Luis de Bethencourt
On Fri, Jun 26, 2015 at 07:49:32AM -0700, Joe Perches wrote:
 On Fri, 2015-06-26 at 16:45 +0200, Luis de Bethencourt wrote:
  Fix all checkpatch.pl warnings:
  WARNING: unnecessary whitespace before a quoted newline
 
 Unassociated but:
 
  diff --git a/drivers/staging/wilc1000/host_interface.c 
  b/drivers/staging/wilc1000/host_interface.c
 []
  @@ -740,7 +740,7 @@ s32 Handle_set_IPAddress(void *drvHandler, u8 
  *pu8IPAddr, u8 idx)
  if (pu8IPAddr[0]  192)
  pu8IPAddr[0] = 0;
   
  -   PRINT_INFO(HOSTINF_DBG, Indx = %d, Handling set  IP = %d.%d.%d.%d \n, 
  idx, pu8IPAddr[0], pu8IPAddr[1], pu8IPAddr[2], pu8IPAddr[3]);
  +   PRINT_INFO(HOSTINF_DBG, Indx = %d, Handling set  IP = %d.%d.%d.%d\n, 
  idx, pu8IPAddr[0], pu8IPAddr[1], pu8IPAddr[2], pu8IPAddr[3]);
 
 These printks with ip addresses could use vsprintf extension %pI4
 
   PRINT_INFO(HOSTINF_DBG, Indx = %d, Handling set  IP = %pI4\n,
  idx, pu8IPAddr);
 
 

Hi Joe,

I could send this as a 5th patch in the series if you'd like, and set you as
author.

-   PRINT_INFO(HOSTINF_DBG, Indx = %d, Handling set  IP = %d.%d.%d.%d\n, idx, 
pu8IPAddr[0], pu8IPAddr[1], pu8IPAddr[2], pu8IPAddr[3]);
+   PRINT_INFO(HOSTINF_DBG, Indx = %d, Handling set  IP = %pI4\n, idx, 
pu8IPAddr);

Thanks,
Luis
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4] staging: wilc1000: cover letter

2015-06-26 Thread Luis de Bethencourt
Patches to be applied on top of
https://patchwork.kernel.org/patch/6655831/

Thanks!
Luis
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/4] staging: wilc1000: switch printks to vsprintf IPv4 extension

2015-06-26 Thread Luis de Bethencourt
Switch printks with IP addresses to use vsprintf extension %pI4.

Suggested-by: Joe Perches j...@perches.com
Signed-off-by: Luis de Bethencourt l...@debethencourt.com
---
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 1915fc6..483926f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -740,7 +740,7 @@ s32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, 
u8 idx)
if (pu8IPAddr[0]  192)
pu8IPAddr[0] = 0;
 
-   PRINT_INFO(HOSTINF_DBG, Indx = %d, Handling set  IP = %d.%d.%d.%d\n, 
idx, pu8IPAddr[0], pu8IPAddr[1], pu8IPAddr[2], pu8IPAddr[3]);
+   PRINT_INFO(HOSTINF_DBG, Indx = %d, Handling set  IP = %pI4\n, idx, 
pu8IPAddr);
 
WILC_memcpy(gs8SetIP[idx], pu8IPAddr, IP_ALEN);
 
@@ -796,7 +796,7 @@ s32 Handle_get_IPAddress(void *drvHandler, u8 *pu8IPAddr, 
u8 idx)
 
s32Error = SendConfigPkt(GET_CFG, strWID, 1, true, (u32)pstrWFIDrv);
 
-   PRINT_INFO(HOSTINF_DBG, %d.%d.%d.%d\n, (u8)(strWID.ps8WidVal[0]), 
(u8)(strWID.ps8WidVal[1]), (u8)(strWID.ps8WidVal[2]), 
(u8)(strWID.ps8WidVal[3]));
+   PRINT_INFO(HOSTINF_DBG, %pI4\n, strWID.ps8WidVal);
 
WILC_memcpy(gs8GetIP[idx], strWID.ps8WidVal, IP_ALEN);
 
@@ -811,7 +811,7 @@ s32 Handle_get_IPAddress(void *drvHandler, u8 *pu8IPAddr, 
u8 idx)
WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
} else {
PRINT_INFO(HOSTINF_DBG, IP address retrieved:: u8IfIdx = 
%d\n, idx);
-   PRINT_INFO(HOSTINF_DBG, %d.%d.%d.%d\n, gs8GetIP[idx][0], 
gs8GetIP[idx][1], gs8GetIP[idx][2], gs8GetIP[idx][3]);
+   PRINT_INFO(HOSTINF_DBG, %pI4\n, gs8GetIP[idx]);
PRINT_INFO(HOSTINF_DBG, \n);
}
 
-- 
2.1.4

This patch is 5/4 because it is a suggestion made by Joe Perches. Based on top
of the previous 4 wilc1000 patches.
https://lkml.org/lkml/2015/6/26/392

Thank you Joe :)
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] staging: wilc1000: fix typos in PRINT_ERR()

2015-06-26 Thread Luis de Bethencourt
Fix typo packe to packet.

Signed-off-by: Luis de Bethencourt l...@debethencourt.com
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 79b7c2a..1915fc6 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3688,7 +3688,7 @@ static void Handle_DelAllSta(void *drvHandler, 
tstrHostIFDelAllSta *pstrDelAllSt
s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv);
if (s32Error) {
 
-   PRINT_ER(Failed to send add station config packe\n);
+   PRINT_ER(Failed to send add station config packet\n);
WILC_ERRORREPORT(s32Error, WILC_FAIL);
}
 
@@ -3735,7 +3735,7 @@ static void Handle_DelStation(void *drvHandler, 
tstrHostIFDelSta *pstrDelStaPara
s32Error = SendConfigPkt(SET_CFG, strWID, 1, false, (u32)pstrWFIDrv);
if (s32Error) {
 
-   PRINT_ER(Failed to send add station config packe\n);
+   PRINT_ER(Failed to send add station config packet\n);
WILC_ERRORREPORT(s32Error, WILC_FAIL);
}
 
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] staging: wilc1000: fix typos in PRINT_ERR()

2015-06-26 Thread Luis de Bethencourt
Fix typo packe to packet.

Signed-off-by: Luis de Bethencourt l...@debethencourt.com
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 79b7c2a..1915fc6 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3688,7 +3688,7 @@ static void Handle_DelAllSta(void *drvHandler, 
tstrHostIFDelAllSta *pstrDelAllSt
s32Error = SendConfigPkt(SET_CFG, strWID, 1, true, (u32)pstrWFIDrv);
if (s32Error) {
 
-   PRINT_ER(Failed to send add station config packe\n);
+   PRINT_ER(Failed to send add station config packet\n);
WILC_ERRORREPORT(s32Error, WILC_FAIL);
}
 
@@ -3735,7 +3735,7 @@ static void Handle_DelStation(void *drvHandler, 
tstrHostIFDelSta *pstrDelStaPara
s32Error = SendConfigPkt(SET_CFG, strWID, 1, false, (u32)pstrWFIDrv);
if (s32Error) {
 
-   PRINT_ER(Failed to send add station config packe\n);
+   PRINT_ER(Failed to send add station config packet\n);
WILC_ERRORREPORT(s32Error, WILC_FAIL);
}
 
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] staging: wilc1000: host_interface: add spaces around '='

2015-06-26 Thread Luis de Bethencourt
On Mon, Jun 22, 2015 at 07:23:01PM +0530, Sunil Shahu wrote:
 Fix coding style error by placing spaces around '=' as suggested by
 checkpatch.pl script.
 
 Signed-off-by: Sunil Shahu shsh...@gmail.com
 ---
  drivers/staging/wilc1000/host_interface.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/staging/wilc1000/host_interface.c 
 b/drivers/staging/wilc1000/host_interface.c
 index 6b10bbb..d1fe73d 100644
 --- a/drivers/staging/wilc1000/host_interface.c
 +++ b/drivers/staging/wilc1000/host_interface.c
 @@ -7945,8 +7945,8 @@ s32 host_int_get_ipaddress(WILC_WFIDrvHandle hWFIDrv, 
 u8 *u16ipadd, u8 idx)
   strHostIFmsg.u16MsgId = HOST_IF_MSG_GET_IPADDRESS;
  
   strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.au8IPAddr = u16ipadd;
 - strHostIFmsg.drvHandler=hWFIDrv;
 - strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.idx= idx;
 + strHostIFmsg.drvHandler = hWFIDrv;
 + strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.idx = idx;
  
   s32Error = WILC_MsgQueueSend(gMsgQHostIF, strHostIFmsg, 
 sizeof(tstrHostIFmsg), NULL);
   if (s32Error) {
 -- 
 1.9.1
 

Appliess cleanly on staging-testing. Removes all checkpatch ERRORS related to
spaces placing in that file.

Reviewed-by: Luis de Bethencourt l...@debethencourt.com
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html