[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d3b4e3b4-b5cc-5b5f-26b6-1d726f5e57c@inria.fr>
Date: Sat, 5 Apr 2025 08:30:55 -0400 (EDT)
From: Julia Lawall <julia.lawall@...ia.fr>
To: Andy Shevchenko <andy.shevchenko@...il.com>
cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Abraham Samuel Adekunle <abrahamadekunle50@...il.com>,
julia.lawall@...ia.fr, andy@...nel.org, dan.carpenter@...aro.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
outreachy@...ts.linux.dev
Subject: Re: [PATCH v2] staging: rtl8723bs: Use % 4096 instead of & 0xfff
On Sat, 5 Apr 2025, Andy Shevchenko wrote:
> On Sat, Apr 5, 2025 at 11:23 AM Greg Kroah-Hartman
> <gregkh@...uxfoundation.org> wrote:
> > On Sat, Apr 05, 2025 at 12:09:59AM +0000, Abraham Samuel Adekunle wrote:
> > > Replace the bitwise AND operator `&` with a modulo
> > > operator `%` and decimal number to make the upper limit visible
> > > and clear what the semantic of it is.
> >
> > Eeek, no. We all "know" what & means (it's a bit mask to handle the
> > issues involved), and we all do NOT know that % will do the same thing
> > at all.
>
> And that is exactly the purpose of the change. The % 4096 makes it
> clearer on what's going on, i.e. we are doing indexes that are wrapped
> around the given number.
Ah, OK. Samuel, indeed, the log message was going in that direction. But
probably it should be more clear. Why is 4096 the upper limit in this
case, for example.
Thanks for the feedback Andy,
julia
>
> > So this just made things more difficult to maintain over time.
> >
> > What tool suggested this type of change to be made to this driver and
> > these lines?
>
> It's not a tool, it was me. I read the code and suggested that change.
>
> --
> With Best Regards,
> Andy Shevchenko
>
Powered by blists - more mailing lists