All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters - style
@ 2018-10-03 20:43 Michael Straube
  2018-10-03 20:43 ` [PATCH 2/3] staging: rtl8188eu: cleanup array declaration " Michael Straube
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Michael Straube @ 2018-10-03 20:43 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Line break array declaration to clear a 'line over 80 characters'
checkpatch warning. For consistency replace 0x0 with 0x00.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 4d55bbdf8fb7..f6171f07599d 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -39,7 +39,10 @@ extern unsigned char REALTEK_96B_IE[];
 /********************************************************
 MCS rate definitions
 *********************************************************/
-unsigned char	MCS_rate_1R[16] = {0xff, 0x00, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
+unsigned char MCS_rate_1R[16] = {
+	0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
 
 /********************************************************
 ChannelPlan definitions
-- 
2.19.0


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

* [PATCH 2/3] staging: rtl8188eu: cleanup array declaration - style
  2018-10-03 20:43 [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters - style Michael Straube
@ 2018-10-03 20:43 ` Michael Straube
  2018-10-03 21:30   ` Joe Perches
  2018-10-03 20:43 ` [PATCH 3/3] staging: rtl8188eu: rewrite if tests " Michael Straube
  2018-10-03 21:26 ` [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters " Joe Perches
  2 siblings, 1 reply; 9+ messages in thread
From: Michael Straube @ 2018-10-03 20:43 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Cleanup array declaration to clear two 'line over 80 characters'
checkpatch warnings and improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 32 ++++++++-----------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index f6171f07599d..f03ac89736de 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -3836,24 +3836,20 @@ Following are the initialization functions for WiFi MLME
 *****************************************************************************/
 
 static struct mlme_handler mlme_sta_tbl[] = {
-	{WIFI_ASSOCREQ,		"OnAssocReq",	&OnAssocReq},
-	{WIFI_ASSOCRSP,		"OnAssocRsp",	&OnAssocRsp},
-	{WIFI_REASSOCREQ,	"OnReAssocReq",	&OnAssocReq},
-	{WIFI_REASSOCRSP,	"OnReAssocRsp",	&OnAssocRsp},
-	{WIFI_PROBEREQ,		"OnProbeReq",	&OnProbeReq},
-	{WIFI_PROBERSP,		"OnProbeRsp",		&OnProbeRsp},
-
-	/*----------------------------------------------------------
-					below 2 are reserved
-	-----------------------------------------------------------*/
-	{0,					"DoReserved",		&DoReserved},
-	{0,					"DoReserved",		&DoReserved},
-	{WIFI_BEACON,		"OnBeacon",		&OnBeacon},
-	{WIFI_ATIM,			"OnATIM",		&OnAtim},
-	{WIFI_DISASSOC,		"OnDisassoc",		&OnDisassoc},
-	{WIFI_AUTH,			"OnAuth",		&OnAuthClient},
-	{WIFI_DEAUTH,		"OnDeAuth",		&OnDeAuth},
-	{WIFI_ACTION,		"OnAction",		&OnAction},
+	{WIFI_ASSOCREQ,	  "OnAssocReq",	  &OnAssocReq},
+	{WIFI_ASSOCRSP,	  "OnAssocRsp",	  &OnAssocRsp},
+	{WIFI_REASSOCREQ, "OnReAssocReq", &OnAssocReq},
+	{WIFI_REASSOCRSP, "OnReAssocRsp", &OnAssocRsp},
+	{WIFI_PROBEREQ,	  "OnProbeReq",	  &OnProbeReq},
+	{WIFI_PROBERSP,	  "OnProbeRsp",	  &OnProbeRsp},
+	{0,		  "DoReserved",	  &DoReserved},
+	{0,		  "DoReserved",	  &DoReserved},
+	{WIFI_BEACON,	  "OnBeacon",	  &OnBeacon},
+	{WIFI_ATIM,	  "OnATIM",	  &OnAtim},
+	{WIFI_DISASSOC,	  "OnDisassoc",	  &OnDisassoc},
+	{WIFI_AUTH,	  "OnAuth",	  &OnAuthClient},
+	{WIFI_DEAUTH,	  "OnDeAuth",	  &OnDeAuth},
+	{WIFI_ACTION,	  "OnAction",	  &OnAction},
 };
 
 int init_hw_mlme_ext(struct adapter *padapter)
-- 
2.19.0


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

* [PATCH 3/3] staging: rtl8188eu: rewrite if tests - style
  2018-10-03 20:43 [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters - style Michael Straube
  2018-10-03 20:43 ` [PATCH 2/3] staging: rtl8188eu: cleanup array declaration " Michael Straube
@ 2018-10-03 20:43 ` Michael Straube
  2018-10-03 21:26 ` [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters " Joe Perches
  2 siblings, 0 replies; 9+ messages in thread
From: Michael Straube @ 2018-10-03 20:43 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Rewrite if tests to clear a 'line over 80 characters' and
'Comparisons should place the constant on the right side of the test'
checkpatch warning.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index f03ac89736de..c6945164ee34 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -3957,7 +3957,7 @@ static void init_channel_list(struct adapter *padapter,
 			if (!has_channel(channel_set, chanset_size, ch))
 				continue;
 
-			if ((0 == padapter->registrypriv.ht_enable) && (8 == o->inc))
+			if (!padapter->registrypriv.ht_enable && o->inc == 8)
 				continue;
 
 			if ((0 == (padapter->registrypriv.cbw40_enable & BIT(1))) &&
-- 
2.19.0


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

* Re: [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters - style
  2018-10-03 20:43 [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters - style Michael Straube
  2018-10-03 20:43 ` [PATCH 2/3] staging: rtl8188eu: cleanup array declaration " Michael Straube
  2018-10-03 20:43 ` [PATCH 3/3] staging: rtl8188eu: rewrite if tests " Michael Straube
@ 2018-10-03 21:26 ` Joe Perches
  2018-10-04 15:54   ` Michael Straube
  2 siblings, 1 reply; 9+ messages in thread
From: Joe Perches @ 2018-10-03 21:26 UTC (permalink / raw)
  To: Michael Straube, gregkh; +Cc: devel, linux-kernel

On Wed, 2018-10-03 at 22:43 +0200, Michael Straube wrote:
> Line break array declaration to clear a 'line over 80 characters'
> checkpatch warning. For consistency replace 0x0 with 0x00.
[]
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
[]
> @@ -39,7 +39,10 @@ extern unsigned char REALTEK_96B_IE[];
>  /********************************************************
>  MCS rate definitions
>  *********************************************************/
> -unsigned char	MCS_rate_1R[16] = {0xff, 0x00, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
> +unsigned char MCS_rate_1R[16] = {
> +	0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
> +};

Might as well make this const u8.

Here and as well the extern declarations in
	drivers/staging/rtl8188eu/core/rtw_mlme.c
and
	drivers/staging/rtl8188eu/include/rtw_mlme.h



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

* Re: [PATCH 2/3] staging: rtl8188eu: cleanup array declaration - style
  2018-10-03 20:43 ` [PATCH 2/3] staging: rtl8188eu: cleanup array declaration " Michael Straube
@ 2018-10-03 21:30   ` Joe Perches
  2018-10-04  8:20     ` Michael Straube
  2018-10-04 12:12     ` Michael Straube
  0 siblings, 2 replies; 9+ messages in thread
From: Joe Perches @ 2018-10-03 21:30 UTC (permalink / raw)
  To: Michael Straube, gregkh; +Cc: devel, linux-kernel

On Wed, 2018-10-03 at 22:43 +0200, Michael Straube wrote:
> Cleanup array declaration to clear two 'line over 80 characters'
> checkpatch warnings and improve readability.
[]
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
[]
> @@ -3836,24 +3836,20 @@ Following are the initialization functions for WiFi MLME
>  *****************************************************************************/
>  
>  static struct mlme_handler mlme_sta_tbl[] = {
> -	{WIFI_ASSOCREQ,		"OnAssocReq",	&OnAssocReq},
> -	{WIFI_ASSOCRSP,		"OnAssocRsp",	&OnAssocRsp},
> -	{WIFI_REASSOCREQ,	"OnReAssocReq",	&OnAssocReq},
> -	{WIFI_REASSOCRSP,	"OnReAssocRsp",	&OnAssocRsp},
> -	{WIFI_PROBEREQ,		"OnProbeReq",	&OnProbeReq},
> -	{WIFI_PROBERSP,		"OnProbeRsp",		&OnProbeRsp},
> -
> -	/*----------------------------------------------------------
> -					below 2 are reserved
> -	-----------------------------------------------------------*/
> -	{0,					"DoReserved",		&DoReserved},
> -	{0,					"DoReserved",		&DoReserved},
> -	{WIFI_BEACON,		"OnBeacon",		&OnBeacon},
> -	{WIFI_ATIM,			"OnATIM",		&OnAtim},
> -	{WIFI_DISASSOC,		"OnDisassoc",		&OnDisassoc},
> -	{WIFI_AUTH,			"OnAuth",		&OnAuthClient},
> -	{WIFI_DEAUTH,		"OnDeAuth",		&OnDeAuth},
> -	{WIFI_ACTION,		"OnAction",		&OnAction},
> +	{WIFI_ASSOCREQ,	  "OnAssocReq",	  &OnAssocReq},
> +	{WIFI_ASSOCRSP,	  "OnAssocRsp",	  &OnAssocRsp},
> +	{WIFI_REASSOCREQ, "OnReAssocReq", &OnAssocReq},
> +	{WIFI_REASSOCRSP, "OnReAssocRsp", &OnAssocRsp},
> +	{WIFI_PROBEREQ,	  "OnProbeReq",	  &OnProbeReq},
> +	{WIFI_PROBERSP,	  "OnProbeRsp",	  &OnProbeRsp},
> +	{0,		  "DoReserved",	  &DoReserved},
> +	{0,		  "DoReserved",	  &DoReserved},
> +	{WIFI_BEACON,	  "OnBeacon",	  &OnBeacon},
> +	{WIFI_ATIM,	  "OnATIM",	  &OnAtim},
> +	{WIFI_DISASSOC,	  "OnDisassoc",	  &OnDisassoc},
> +	{WIFI_AUTH,	  "OnAuth",	  &OnAuthClient},
> +	{WIFI_DEAUTH,	  "OnDeAuth",	  &OnDeAuth},
> +	{WIFI_ACTION,	  "OnAction",	  &OnAction},
>  };

Perhaps const here too, and as well, the struct
declaration could use const char * instead of char *




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

* Re: [PATCH 2/3] staging: rtl8188eu: cleanup array declaration - style
  2018-10-03 21:30   ` Joe Perches
@ 2018-10-04  8:20     ` Michael Straube
  2018-10-04 12:12     ` Michael Straube
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Straube @ 2018-10-04  8:20 UTC (permalink / raw)
  To: Joe Perches, gregkh; +Cc: devel, linux-kernel

On 10/3/18 11:30 PM, Joe Perches wrote:
> On Wed, 2018-10-03 at 22:43 +0200, Michael Straube wrote:
>> Cleanup array declaration to clear two 'line over 80 characters'
>> checkpatch warnings and improve readability.
> []
>> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> []
>> @@ -3836,24 +3836,20 @@ Following are the initialization functions for WiFi MLME
>>   *****************************************************************************/
>>   
>>   static struct mlme_handler mlme_sta_tbl[] = {
>> -	{WIFI_ASSOCREQ,		"OnAssocReq",	&OnAssocReq},
>> -	{WIFI_ASSOCRSP,		"OnAssocRsp",	&OnAssocRsp},
>> -	{WIFI_REASSOCREQ,	"OnReAssocReq",	&OnAssocReq},
>> -	{WIFI_REASSOCRSP,	"OnReAssocRsp",	&OnAssocRsp},
>> -	{WIFI_PROBEREQ,		"OnProbeReq",	&OnProbeReq},
>> -	{WIFI_PROBERSP,		"OnProbeRsp",		&OnProbeRsp},
>> -
>> -	/*----------------------------------------------------------
>> -					below 2 are reserved
>> -	-----------------------------------------------------------*/
>> -	{0,					"DoReserved",		&DoReserved},
>> -	{0,					"DoReserved",		&DoReserved},
>> -	{WIFI_BEACON,		"OnBeacon",		&OnBeacon},
>> -	{WIFI_ATIM,			"OnATIM",		&OnAtim},
>> -	{WIFI_DISASSOC,		"OnDisassoc",		&OnDisassoc},
>> -	{WIFI_AUTH,			"OnAuth",		&OnAuthClient},
>> -	{WIFI_DEAUTH,		"OnDeAuth",		&OnDeAuth},
>> -	{WIFI_ACTION,		"OnAction",		&OnAction},
>> +	{WIFI_ASSOCREQ,	  "OnAssocReq",	  &OnAssocReq},
>> +	{WIFI_ASSOCRSP,	  "OnAssocRsp",	  &OnAssocRsp},
>> +	{WIFI_REASSOCREQ, "OnReAssocReq", &OnAssocReq},
>> +	{WIFI_REASSOCRSP, "OnReAssocRsp", &OnAssocRsp},
>> +	{WIFI_PROBEREQ,	  "OnProbeReq",	  &OnProbeReq},
>> +	{WIFI_PROBERSP,	  "OnProbeRsp",	  &OnProbeRsp},
>> +	{0,		  "DoReserved",	  &DoReserved},
>> +	{0,		  "DoReserved",	  &DoReserved},
>> +	{WIFI_BEACON,	  "OnBeacon",	  &OnBeacon},
>> +	{WIFI_ATIM,	  "OnATIM",	  &OnAtim},
>> +	{WIFI_DISASSOC,	  "OnDisassoc",	  &OnDisassoc},
>> +	{WIFI_AUTH,	  "OnAuth",	  &OnAuthClient},
>> +	{WIFI_DEAUTH,	  "OnDeAuth",	  &OnDeAuth},
>> +	{WIFI_ACTION,	  "OnAction",	  &OnAction},
>>   };
> 
> Perhaps const here too, and as well, the struct
> declaration could use const char * instead of char *
>

Just to be sure, it should be

static const struct mlme_handler mlme_sta_tbl[] = {

?

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

* Re: [PATCH 2/3] staging: rtl8188eu: cleanup array declaration - style
  2018-10-03 21:30   ` Joe Perches
  2018-10-04  8:20     ` Michael Straube
@ 2018-10-04 12:12     ` Michael Straube
  2018-10-04 18:10       ` Joe Perches
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Straube @ 2018-10-04 12:12 UTC (permalink / raw)
  To: Joe Perches, gregkh; +Cc: devel, linux-kernel

On 10/3/18 11:30 PM, Joe Perches wrote:
   
>>   static struct mlme_handler mlme_sta_tbl[] = {
> 
> Perhaps const here too, and as well, the struct
> declaration could use const char * instead of char *
> 

Making it const gives following warning.

drivers/staging/rtl8188eu/core/rtw_mlme_ext.c: In function 'mgt_dispatcher':
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4114:9: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   ptable = mlme_sta_tbl;
          ^

So I'll only change the char * to const char *.
Thanks.

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

* Re: [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters - style
  2018-10-03 21:26 ` [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters " Joe Perches
@ 2018-10-04 15:54   ` Michael Straube
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Straube @ 2018-10-04 15:54 UTC (permalink / raw)
  To: Joe Perches, gregkh; +Cc: devel, linux-kernel

Am 03.10.18 um 23:26 schrieb Joe Perches:
> On Wed, 2018-10-03 at 22:43 +0200, Michael Straube wrote:
>> Line break array declaration to clear a 'line over 80 characters'
>> checkpatch warning. For consistency replace 0x0 with 0x00.
> []
>> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> []
>> @@ -39,7 +39,10 @@ extern unsigned char REALTEK_96B_IE[];
>>   /********************************************************
>>   MCS rate definitions
>>   *********************************************************/
>> -unsigned char	MCS_rate_1R[16] = {0xff, 0x00, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
>> +unsigned char MCS_rate_1R[16] = {
>> +	0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>> +};
> 
> Might as well make this const u8.
> 
> Here and as well the extern declarations in
> 	drivers/staging/rtl8188eu/core/rtw_mlme.c
> and
> 	drivers/staging/rtl8188eu/include/rtw_mlme.h
> 
> 

I'll send a patch with your suggestions.
Thanks.

Michael

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

* Re: [PATCH 2/3] staging: rtl8188eu: cleanup array declaration - style
  2018-10-04 12:12     ` Michael Straube
@ 2018-10-04 18:10       ` Joe Perches
  0 siblings, 0 replies; 9+ messages in thread
From: Joe Perches @ 2018-10-04 18:10 UTC (permalink / raw)
  To: Michael Straube, gregkh; +Cc: devel, linux-kernel

On Thu, 2018-10-04 at 14:12 +0200, Michael Straube wrote:
> On 10/3/18 11:30 PM, Joe Perches wrote:
>    
> > >   static struct mlme_handler mlme_sta_tbl[] = {
> > 
> > Perhaps const here too, and as well, the struct
> > declaration could use const char * instead of char *
> > 
> 
> Making it const gives following warning.
> 
> drivers/staging/rtl8188eu/core/rtw_mlme_ext.c: In function 'mgt_dispatcher':
> drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4114:9: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>    ptable = mlme_sta_tbl;

No worries, then it's not appropriate to use const.

It's just most common for this sort of table to be const
but if this driver is reassigning values in the table,
then it can't be const.

It is possible though that the code might not be suitable
for multiple simultaneous instances of the device type.

Dunno.  I don't use it nor have I inspected the code.


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

end of thread, other threads:[~2018-10-04 18:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 20:43 [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters - style Michael Straube
2018-10-03 20:43 ` [PATCH 2/3] staging: rtl8188eu: cleanup array declaration " Michael Straube
2018-10-03 21:30   ` Joe Perches
2018-10-04  8:20     ` Michael Straube
2018-10-04 12:12     ` Michael Straube
2018-10-04 18:10       ` Joe Perches
2018-10-03 20:43 ` [PATCH 3/3] staging: rtl8188eu: rewrite if tests " Michael Straube
2018-10-03 21:26 ` [PATCH 1/3] staging: rtl8188eu: fix line over 80 characters " Joe Perches
2018-10-04 15:54   ` Michael Straube

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.