Re: [PATCH] mm/hugetlb_vmemmap: Use max() macro to simplify the code
From: Matthew Wilcox
Date: Wed Jan 21 2026 - 01:18:06 EST
On Wed, Jan 21, 2026 at 09:51:14AM +0800, zenghongling wrote:
> Use the max() macro to simplify the function and improve
> its readability.
How does this improve readability? I understand what this does in
the ternary form. I have to think far harder about it in the max()
form.
> if (!is_power_of_2(sizeof(struct page)))
> return 0;
> - return size > 0 ? size : 0;
> + return max(size, 0);
> }