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

From: David Hildenbrand (Red Hat)

Date: Thu Nov 27 2025 - 03:07:28 EST


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@xxxxxxxxxx>
Suggested-by: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Suggested-by: David Laight <david.laight.linux@xxxxxxxxx>
Signed-off-by: Sahil Chandna <chandna.sahil@xxxxxxxxx>
---

Acked-by: David Hildenbrand (Red Hat) <david@xxxxxxxxxx>

--
Cheers

David