Re: [PATCH] staging: rtl8723bs: fix coding style in rtw_cmd.c
From: Andy Shevchenko
Date: Tue Jun 02 2026 - 20:20:10 EST
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