From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: "Krzysztof Woś" <krzysztofina2022@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
khushalchitturi@gmail.com, architanant5@gmail.com,
s9430939@naver.com, kees@kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: fix coding style in rtw_cmd.c
Date: Wed, 3 Jun 2026 03:15:57 +0300 [thread overview]
Message-ID: <ah9yPVVEwiBF_BAo@ashevche-desk.local> (raw)
In-Reply-To: <ah9nar_KAw49VKfO@ashevche-desk.local>
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
prev parent reply other threads:[~2026-06-03 0:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 20:10 Krzysztof Woś
2026-05-25 20:23 ` Ahmet Sezgin Duran
2026-06-02 23:29 ` Andy Shevchenko
2026-06-03 0:15 ` Andy Shevchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ah9yPVVEwiBF_BAo@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=architanant5@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kees@kernel.org \
--cc=khushalchitturi@gmail.com \
--cc=krzysztofina2022@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=s9430939@naver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®