linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] staging: rtl8723bs: fix yoda condition in rtl8723b_cmd
@ 2025-07-16 11:38 Ignacio Peña
  2025-07-16 11:38 ` [PATCH 2/4] staging: rtl8723bs: remove unnecessary braces " Ignacio Peña
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ignacio Peña @ 2025-07-16 11:38 UTC (permalink / raw)
  To: gregkh, linux-staging; +Cc: Ignacio Pena

From: Ignacio Pena <ignacio.pena87@gmail.com>

Fix checkpatch warning about comparisons that should place the
constant on the right side of the test.

Signed-off-by: Ignacio Pena <ignacio.pena87@gmail.com>
---
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
index 56526056d..abc123def 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
@@ -24,7 +24,7 @@ static u8 _is_fw_read_cmd_down(struct adapter *padapter, u8 msgbox_num)
 
 	do {
 		valid = rtw_read8(padapter, REG_HMETFR) & BIT(msgbox_num);
-		if (0 == valid) {
+		if (valid == 0) {
 			read_down = true;
 		}
 	} while ((!read_down) && (retry_cnts--));
-- 
2.39.5

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

* [PATCH 2/4] staging: rtl8723bs: remove unnecessary braces in rtl8723b_cmd
  2025-07-16 11:38 [PATCH 1/4] staging: rtl8723bs: fix yoda condition in rtl8723b_cmd Ignacio Peña
@ 2025-07-16 11:38 ` Ignacio Peña
  2025-07-16 11:38 ` [PATCH 3/4] staging: rtl8723bs: fix block comment alignment " Ignacio Peña
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Ignacio Peña @ 2025-07-16 11:38 UTC (permalink / raw)
  To: gregkh, linux-staging; +Cc: Ignacio Pena

From: Ignacio Pena <ignacio.pena87@gmail.com>

Remove braces that are not necessary for single statement blocks
to fix checkpatch warnings.

Signed-off-by: Ignacio Pena <ignacio.pena87@gmail.com>
---
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
index abc123def..def456abc 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
@@ -24,9 +24,8 @@ static u8 _is_fw_read_cmd_down(struct adapter *padapter, u8 msgbox_num)
 
 	do {
 		valid = rtw_read8(padapter, REG_HMETFR) & BIT(msgbox_num);
-		if (valid == 0) {
+		if (valid == 0)
 			read_down = true;
-		}
 	} while ((!read_down) && (retry_cnts--));
 
 	return read_down;
@@ -57,13 +56,11 @@ s32 FillH2CCmd8723B(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmd
 	if (mutex_lock_interruptible(&(adapter_to_dvobj(padapter)->h2c_fwcmd_mutex)))
 		return ret;
 
-	if (!pCmdBuffer) {
+	if (!pCmdBuffer)
 		goto exit;
-	}
 
-	if (CmdLen > RTL8723B_MAX_CMD_LEN) {
+	if (CmdLen > RTL8723B_MAX_CMD_LEN)
 		goto exit;
-	}
 
 	if (padapter->bSurpriseRemoved)
 		goto exit;
-- 
2.39.5

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

* [PATCH 3/4] staging: rtl8723bs: fix block comment alignment in rtl8723b_cmd
  2025-07-16 11:38 [PATCH 1/4] staging: rtl8723bs: fix yoda condition in rtl8723b_cmd Ignacio Peña
  2025-07-16 11:38 ` [PATCH 2/4] staging: rtl8723bs: remove unnecessary braces " Ignacio Peña
@ 2025-07-16 11:38 ` Ignacio Peña
  2025-07-16 12:01   ` Greg KH
  2025-07-16 14:58   ` Dan Carpenter
  2025-07-16 11:38 ` [PATCH 4/4] staging: rtl8723bs: fix tab spacing " Ignacio Peña
  2025-07-16 14:57 ` [PATCH 1/4] staging: rtl8723bs: fix yoda condition " Dan Carpenter
  3 siblings, 2 replies; 8+ messages in thread
From: Ignacio Peña @ 2025-07-16 11:38 UTC (permalink / raw)
  To: gregkh, linux-staging; +Cc: Ignacio Pena

From: Ignacio Pena <ignacio.pena87@gmail.com>

Fix block comment formatting to align the * on each line properly
according to kernel coding style.

Signed-off-by: Ignacio Pena <ignacio.pena87@gmail.com>
---
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
index def456abc..789abc123 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
@@ -34,13 +34,13 @@ static u8 _is_fw_read_cmd_down(struct adapter *padapter, u8 msgbox_num)
 
 
 /*****************************************
-* H2C Msg format :
-*| 31 - 8		|7-5	| 4 - 0	|
-*| h2c_msg	|Class	|CMD_ID |
-*| 31-0						|
-*| Ext msg					|
-*
-******************************************/
+ * H2C Msg format :
+ * | 31 - 8		|7-5	| 4 - 0	|
+ * | h2c_msg	|Class	|CMD_ID |
+ * | 31-0						|
+ * | Ext msg					|
+ *
+ ******************************************/
 s32 FillH2CCmd8723B(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer)
 {
 	u8 h2c_box_num;
@@ -435,13 +435,13 @@ void rtl8723b_set_FwPwrMode_cmd(struct adapter *padapter, u8 psmode)
 
 		}
 
-/* offload to FW if fw version > v15.10
-		pmlmeext->DrvBcnEarly = 0;
-		pmlmeext->DrvBcnTimeOut =7;
-
-		if ((pmlmeext->DrvBcnEarly!= 0Xff) && (pmlmeext->DrvBcnTimeOut!= 0xff))
-			u1H2CPwrModeParm[H2C_PWRMODE_LEN-1] = BIT(0) | ((pmlmeext->DrvBcnEarly<<1)&0x0E) |((pmlmeext->DrvBcnTimeOut<<4)&0xf0) ;
-*/
+/*
+ * offload to FW if fw version > v15.10
+ *		pmlmeext->DrvBcnEarly = 0;
+ *		pmlmeext->DrvBcnTimeOut =7;
+ *
+ *		if ((pmlmeext->DrvBcnEarly!= 0Xff) && (pmlmeext->DrvBcnTimeOut!= 0xff))
+ *			u1H2CPwrModeParm[H2C_PWRMODE_LEN-1] = BIT(0) | ((pmlmeext->DrvBcnEarly<<1)&0x0E) |((pmlmeext->DrvBcnTimeOut<<4)&0xf0) ;
+ */
 
 	}
 
-- 
2.39.5

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

* [PATCH 4/4] staging: rtl8723bs: fix tab spacing in rtl8723b_cmd
  2025-07-16 11:38 [PATCH 1/4] staging: rtl8723bs: fix yoda condition in rtl8723b_cmd Ignacio Peña
  2025-07-16 11:38 ` [PATCH 2/4] staging: rtl8723bs: remove unnecessary braces " Ignacio Peña
  2025-07-16 11:38 ` [PATCH 3/4] staging: rtl8723bs: fix block comment alignment " Ignacio Peña
@ 2025-07-16 11:38 ` Ignacio Peña
  2025-07-16 12:01   ` Greg KH
  2025-07-16 14:57 ` [PATCH 1/4] staging: rtl8723bs: fix yoda condition " Dan Carpenter
  3 siblings, 1 reply; 8+ messages in thread
From: Ignacio Peña @ 2025-07-16 11:38 UTC (permalink / raw)
  To: gregkh, linux-staging; +Cc: Ignacio Pena

From: Ignacio Pena <ignacio.pena87@gmail.com>

Fix checkpatch warning about space before tab in commented code.

Signed-off-by: Ignacio Pena <ignacio.pena87@gmail.com>
---
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
index 789abc123..012def345 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
@@ -77,7 +77,7 @@ s32 FillH2CCmd8723B(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmd
 		else {
 			memcpy((u8 *)(&h2c_cmd)+1, pCmdBuffer, 3);
 			memcpy((u8 *)(&h2c_cmd_ex), pCmdBuffer+3, CmdLen-3);
-/* 			*(u8 *)(&h2c_cmd) |= BIT(7); */
+/*			*(u8 *)(&h2c_cmd) |= BIT(7); */
 		}
 
 		*(u8 *)(&h2c_cmd) |= ElementID;
-- 
2.39.5

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

* Re: [PATCH 3/4] staging: rtl8723bs: fix block comment alignment in rtl8723b_cmd
  2025-07-16 11:38 ` [PATCH 3/4] staging: rtl8723bs: fix block comment alignment " Ignacio Peña
@ 2025-07-16 12:01   ` Greg KH
  2025-07-16 14:58   ` Dan Carpenter
  1 sibling, 0 replies; 8+ messages in thread
From: Greg KH @ 2025-07-16 12:01 UTC (permalink / raw)
  To: Ignacio Peña; +Cc: linux-staging

On Wed, Jul 16, 2025 at 07:38:07AM -0400, Ignacio Peña wrote:
> +/*
> + * offload to FW if fw version > v15.10
> + *		pmlmeext->DrvBcnEarly = 0;
> + *		pmlmeext->DrvBcnTimeOut =7;
> + *
> + *		if ((pmlmeext->DrvBcnEarly!= 0Xff) && (pmlmeext->DrvBcnTimeOut!= 0xff))
> + *			u1H2CPwrModeParm[H2C_PWRMODE_LEN-1] = BIT(0) | ((pmlmeext->DrvBcnEarly<<1)&0x0E) |((pmlmeext->DrvBcnTimeOut<<4)&0xf0) ;
> + */

Why is this even still needed?  Shouldn't it just be deleted instead?

thanks,

greg k-h

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

* Re: [PATCH 4/4] staging: rtl8723bs: fix tab spacing in rtl8723b_cmd
  2025-07-16 11:38 ` [PATCH 4/4] staging: rtl8723bs: fix tab spacing " Ignacio Peña
@ 2025-07-16 12:01   ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2025-07-16 12:01 UTC (permalink / raw)
  To: Ignacio Peña; +Cc: linux-staging

On Wed, Jul 16, 2025 at 07:38:08AM -0400, Ignacio Peña wrote:
> From: Ignacio Pena <ignacio.pena87@gmail.com>
> 
> Fix checkpatch warning about space before tab in commented code.
> 
> Signed-off-by: Ignacio Pena <ignacio.pena87@gmail.com>
> ---
>  drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
> index 789abc123..012def345 100644
> --- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
> +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
> @@ -77,7 +77,7 @@ s32 FillH2CCmd8723B(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmd
>  		else {
>  			memcpy((u8 *)(&h2c_cmd)+1, pCmdBuffer, 3);
>  			memcpy((u8 *)(&h2c_cmd_ex), pCmdBuffer+3, CmdLen-3);
> -/* 			*(u8 *)(&h2c_cmd) |= BIT(7); */
> +/*			*(u8 *)(&h2c_cmd) |= BIT(7); */

Why is this line even still needed?


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

* Re: [PATCH 1/4] staging: rtl8723bs: fix yoda condition in rtl8723b_cmd
  2025-07-16 11:38 [PATCH 1/4] staging: rtl8723bs: fix yoda condition in rtl8723b_cmd Ignacio Peña
                   ` (2 preceding siblings ...)
  2025-07-16 11:38 ` [PATCH 4/4] staging: rtl8723bs: fix tab spacing " Ignacio Peña
@ 2025-07-16 14:57 ` Dan Carpenter
  3 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2025-07-16 14:57 UTC (permalink / raw)
  To: Ignacio Peña; +Cc: gregkh, linux-staging

On Wed, Jul 16, 2025 at 07:38:05AM -0400, Ignacio Peña wrote:
> From: Ignacio Pena <ignacio.pena87@gmail.com>
> 
> Fix checkpatch warning about comparisons that should place the
> constant on the right side of the test.
> 
> Signed-off-by: Ignacio Pena <ignacio.pena87@gmail.com>
> ---
>  drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
> index 56526056d..abc123def 100644
> --- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
> +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
> @@ -24,7 +24,7 @@ static u8 _is_fw_read_cmd_down(struct adapter *padapter, u8 msgbox_num)
>  
>  	do {
>  		valid = rtw_read8(padapter, REG_HMETFR) & BIT(msgbox_num);
> -		if (0 == valid) {
> +		if (valid == 0) {

Is "valid" a number?  Like, are counting the number of valid things?
"== 0," means it's a number or an ammount.  Also it's idiomatic for
strcmp() so we would say "if (strcmp(str, "foo") == 0)" to mean the
strings are equal.  For boolean, we would say "if (!valid)" except
valid really means invalid in this context...

This whole function is garbage.  Re-write it.

regards,
dan carpenter


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

* Re: [PATCH 3/4] staging: rtl8723bs: fix block comment alignment in rtl8723b_cmd
  2025-07-16 11:38 ` [PATCH 3/4] staging: rtl8723bs: fix block comment alignment " Ignacio Peña
  2025-07-16 12:01   ` Greg KH
@ 2025-07-16 14:58   ` Dan Carpenter
  1 sibling, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2025-07-16 14:58 UTC (permalink / raw)
  To: Ignacio Peña; +Cc: gregkh, linux-staging

On Wed, Jul 16, 2025 at 07:38:07AM -0400, Ignacio Peña wrote:
> From: Ignacio Pena <ignacio.pena87@gmail.com>
> 
> Fix block comment formatting to align the * on each line properly
> according to kernel coding style.
> 
> Signed-off-by: Ignacio Pena <ignacio.pena87@gmail.com>
> ---
>  drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
> index def456abc..789abc123 100644
> --- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
> +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
> @@ -34,13 +34,13 @@ static u8 _is_fw_read_cmd_down(struct adapter *padapter, u8 msgbox_num)
>  
>  
>  /*****************************************
> -* H2C Msg format :
> -*| 31 - 8		|7-5	| 4 - 0	|
> -*| h2c_msg	|Class	|CMD_ID |
> -*| 31-0						|
> -*| Ext msg					|
> -*
> -******************************************/
> + * H2C Msg format :
> + * | 31 - 8		|7-5	| 4 - 0	|
> + * | h2c_msg	|Class	|CMD_ID |
> + * | 31-0						|
> + * | Ext msg					|
> + *
> + ******************************************/
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is not the correct comment format.

regards,
dan carpenter


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

end of thread, other threads:[~2025-07-16 14:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16 11:38 [PATCH 1/4] staging: rtl8723bs: fix yoda condition in rtl8723b_cmd Ignacio Peña
2025-07-16 11:38 ` [PATCH 2/4] staging: rtl8723bs: remove unnecessary braces " Ignacio Peña
2025-07-16 11:38 ` [PATCH 3/4] staging: rtl8723bs: fix block comment alignment " Ignacio Peña
2025-07-16 12:01   ` Greg KH
2025-07-16 14:58   ` Dan Carpenter
2025-07-16 11:38 ` [PATCH 4/4] staging: rtl8723bs: fix tab spacing " Ignacio Peña
2025-07-16 12:01   ` Greg KH
2025-07-16 14:57 ` [PATCH 1/4] staging: rtl8723bs: fix yoda condition " Dan Carpenter

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