From: "Linus Probert" <linus@probert.se>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>,
"Linus Probert" <linus.probert@gmail.com>
Cc: "Julia Lawall" <julia.lawall@inria.fr>,
"Kernel Janitors List" <kernel-janitors@vger.kernel.org>
Subject: Re: more potential janitor work: simplifying test for power of 2
Date: Thu, 02 Apr 2026 15:04:22 +0200 [thread overview]
Message-ID: <DHIOV1XVG37A.11HWRSCG0AD3G@probert.se> (raw)
In-Reply-To: <bcd30f78-7cbb-4284-dc18-302b549a00e2@crashcourse.ca>
On Thu Apr 2, 2026 at 2:40 PM CEST, Robert P. J. Day wrote:
> On Thu, 2 Apr 2026, Linus Probert wrote:
>
>> On Thu Apr 2, 2026 at 12:07 PM CEST, Julia Lawall wrote:
>> >
>> >
>> > On Thu, 2 Apr 2026, Linus Probert wrote:
>> >
[...]
>
> Not to toot my own horn but if you go back through history, I was
> the one who kicked off the introduction of the first "is power of 2"
> helper function many, many years ago:
Totally worth a toot, it's a neat piece of bit operation.
[...]
> And, no, a lot of that content was not immediately obvious as a
> candidate for simplification; when I wrote my regex searching scripts,
> I deliberately made them overly general *knowing* I would get false
> positives, then I manually checked whether they should be simplified.
> It never occurred to me that some of those checks were actually asking
> whether more than one bit flag was set, which semantically is asking a
> different question.
Throwing a wide net makes sense. I first noted this alternate 'question'
pattern after some scrolling. Didn't consider that case at first.
Just wanted to share that finding since others might have picked up on
this opportunity to contribute and perhaps not noticed the "semantic
difference".
> Anyway, people were asking about janitorial work so I threw out a
> couple of ideas. Whether they're worth pursing ... not my call.
I was asking and appreciate the suggestions. If you have more stuff
knocking about I'm certain it will be appreciated by some of us
neophytes.
I'm learning that the hard part isn't immediately the code change. The
whole email patch cycle and high standards on commit message subject and
content takes some getting used to.
I doubt the kernel project is a large contributor to
https://latenightcommits.com/ :)
Br,
Linus
next prev parent reply other threads:[~2026-04-02 13:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 11:49 more potential janitor work: simplifying test for power of 2 Robert P. J. Day
2026-04-01 12:16 ` Linus Probert
2026-04-02 9:50 ` Linus Probert
2026-04-02 10:07 ` Julia Lawall
2026-04-02 11:57 ` Linus Probert
2026-04-02 12:40 ` Robert P. J. Day
2026-04-02 13:04 ` Linus Probert [this message]
2026-04-02 13:21 ` Robert P. J. Day
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=DHIOV1XVG37A.11HWRSCG0AD3G@probert.se \
--to=linus@probert.se \
--cc=julia.lawall@inria.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.probert@gmail.com \
--cc=rpjday@crashcourse.ca \
/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