Re: [PATCH v5 4/4] mm: Use ARRAY_END() instead of open-coding it

From: Kees Cook
Date: Wed Dec 10 2025 - 20:38:40 EST


On Thu, Dec 11, 2025 at 01:21:59AM +0100, Alejandro Colomar wrote:
> Hi Kees,
>
> On Thu, Dec 11, 2025 at 08:18:56AM +0900, Kees Cook wrote:
> >
> >
> > On December 11, 2025 7:46:49 AM GMT+09:00, Alejandro Colomar <alx@xxxxxxxxxx> wrote:
> > >Cc: Kees Cook <kees@xxxxxxxxxx>
> > >Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> > >Signed-off-by: Alejandro Colomar <alx@xxxxxxxxxx>
> >
> > Hm, this seems to be missing a commit log body?
>
> Actually, there's not much to it. The patch uses ARRAY_END() where it
> was being open-coded. There aren't any bugs in this code, so it's
> purely cosmetic (and of course, to prevent future issues, in case the
> code is modified). Maybe I could say precisely that. What would you
> say here?

Yup, that would be perfect. A what/why, even a single sentence, is a
minimum for commit log bodies.

> > Are there other open-coded instances that could be replaced? This seems like a great task for a coccinelle script.
>
> There are many, but I wanted to keep them out of this initial patch set,
> to make it easy to apply. When this one is applied, I could work on a
> second round that replaces more of them with coccinelle. This is just
> for showing that this is beneficial, and to make sure that you ask for
> more. :)
>
> Also, it's easier if there are few maintainers that would block an
> initial patch set. If restrict the patch set to a few files, I don't
> have to deal with many of them. Once I get used to this, I'll deal with
> all of them.

Sounds good!

-Kees

--
Kees Cook