Re: [PATCH v3 1/3] mm: pagewalk: simplify hugepage boundary calculation using min()

David Hildenbrand (Red Hat)
2025-11-27T08:07:32Z

On 11/27/25 06:11, Sahil Chandna wrote:
> Use the min() macro to compute the minimum value instead of an explicit
> ternary expression. This improves readability and matches common kernel
> style. Also change the return hugepage boundary expression for better
> clarity.
>
> This was flagged by Coccinelle
> (misc/minmax.cocci) as an opportunity to use min().
>
> Found by: make coccicheck MODE=report M=mm/
> No functional change intended.
>
> Suggested-by: David Hildenbrand (Red Hat) <david@kernel.org>
> Suggested-by: Matthew Wilcox <willy@infradead.org>
> Suggested-by: David Laight <david.laight.linux@gmail.com>
> Signed-off-by: Sahil Chandna <chandna.sahil@gmail.com>
> ---

Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>

--
Cheers

David