[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7f48a42-1921-77d7-1cf4-fb6ea8f6fb7e@inria.fr>
Date: Sun, 6 Apr 2025 08:59:52 -0400 (EDT)
From: Julia Lawall <julia.lawall@...ia.fr>
To: Samuel Abraham <abrahamadekunle50@...il.com>
cc: Julia Lawall <julia.lawall@...ia.fr>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 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, Samuel Abraham wrote:
> On Sat, Apr 5, 2025 at 1:30 PM Julia Lawall <julia.lawall@...ia.fr> wrote:
> >
> >
> >
> > 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.
>
> Okay thank you Julia.
> So I can add something like this to the commit message?
>
> "Replace the bitwise AND operator `&` with a modulo
> operator `%` and decimal number to make the upper limit visible
> and clear that we are doing indexes that are wrapped around the given number"?
No. First say what the upper limit is. Then explain that a module
operation is thus more appropriate than a bit mask. People need to
understand the reasoning behind the change. By saying "make the upper
limit visible" you are asking them to trust your reasoning, or more likely
requiring them to reconstruct it. You need to make explicit all the
information that is needed to understand the change, so people will know
what to look for to verify it.
> You also said I should add a patch for the white space around binary operators.
> I did it together because the changes were on the same line.
> Should I still add a second patch for that change?
It's quite a different issue. So a second patch seems reasonable. YOu
can do it before yours. Then if someone still doesn't unlike the modulo
patch, the spacing patch can still be accepted.
julia
Powered by blists - more mailing lists