[PATCH] staging: rtl8723bs: fix coding style in rtw_cmd.c

Krzysztof Woś posted 1 patch 2 weeks ago
drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] staging: rtl8723bs: fix coding style in rtw_cmd.c
Posted by Krzysztof Woś 2 weeks ago
Fix spdx comment style and indentation in rtw_cmd.c to resolve
errors and warnings reported by checkpatch.pl.

Signed-off-by: Krzysztof Woś <krzysztofina2022@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index c1185c25ed36..dac7a615d158 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -184,7 +184,8 @@ int rtw_init_cmd_priv(struct	cmd_priv *pcmdpriv)
 		return -ENOMEM;
 	}
 
-	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
+	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 -
+		((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
 
 	pcmdpriv->cmd_issued_cnt = 0;
 	pcmdpriv->cmd_done_cnt = 0;
-- 
2.47.3

Re: [PATCH] staging: rtl8723bs: fix coding style in rtw_cmd.c
Posted by Andy Shevchenko 5 days, 22 hours ago
On Mon, May 25, 2026 at 10:10:01PM +0200, Krzysztof Woś wrote:
> Fix spdx comment style and indentation in rtw_cmd.c to resolve
> errors and warnings reported by checkpatch.pl.

...

> -	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
> +	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 -
> +		((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);

Is this the only single issue of the type in the entire driver?

Also, now it's harder to read. What this code does is as simple as

	pcmdpriv->rsp_buf = ALIGN(pcmdpriv->rsp_allocated_buf, 4);

(need linux/align.h to be included).

-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH] staging: rtl8723bs: fix coding style in rtw_cmd.c
Posted by Andy Shevchenko 5 days, 21 hours ago
On Wed, Jun 03, 2026 at 02:29:50AM +0300, Andy Shevchenko wrote:
> On Mon, May 25, 2026 at 10:10:01PM +0200, Krzysztof Woś wrote:

...

> > -	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
> > +	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 -
> > +		((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
> 
> Is this the only single issue of the type in the entire driver?
> 
> Also, now it's harder to read. What this code does is as simple as
> 
> 	pcmdpriv->rsp_buf = ALIGN(pcmdpriv->rsp_allocated_buf, 4);

Actually it is off-by-one kinda case, so, please double check the result for
last two bits being 0. If the rsp_allocated_buf is byte type (or void *), the
proper one most likely will be

	pcmdpriv->rsp_buf = ALIGN(pcmdpriv->rsp_allocated_buf + 1, 4);

> (need linux/align.h to be included).

-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH] staging: rtl8723bs: fix coding style in rtw_cmd.c
Posted by Ahmet Sezgin Duran 2 weeks ago
On 5/25/26 11:10 PM, Krzysztof Woś wrote:
> Fix spdx comment style and indentation in rtw_cmd.c to resolve
> errors and warnings reported by checkpatch.pl.
> 
> Signed-off-by: Krzysztof Woś <krzysztofina2022@gmail.com>
> ---
>   drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> index c1185c25ed36..dac7a615d158 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> @@ -184,7 +184,8 @@ int rtw_init_cmd_priv(struct	cmd_priv *pcmdpriv)
>   		return -ENOMEM;
>   	}
>   
> -	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
> +	pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 -
> +		((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
>   
>   	pcmdpriv->cmd_issued_cnt = 0;
>   	pcmdpriv->cmd_done_cnt = 0;

Does not apply to staging-testing branch.

Regards,
Ahmet Sezgin Duran