Re: [PATCH 1/2] mm: huge_memory: use sysfs_match_string() in defrag_store()
From: Breno Leitao
Date: Thu Apr 02 2026 - 09:51:22 EST
On Thu, Apr 02, 2026 at 10:21:30AM +0200, David Hildenbrand (Arm) wrote:
> On 3/20/26 17:05, Breno Leitao wrote:
> > +enum defrag_mode {
> > + DEFRAG_ALWAYS = 0,
> > + DEFRAG_DEFER = 1,
> > + DEFRAG_DEFER_MADVISE = 2,
> > + DEFRAG_MADVISE = 3,
> > + DEFRAG_NEVER = 4,
> > +};
>
> These numbers should get assigned as default (C standard) I think, and
> can be dropped.
You're correct that they would be assigned by default. However, I've
explicitly set them to clarify that we iterate over these enum values
using an integer and require these specific values.
This was discussed in the previous patch series:
https://lore.kernel.org/all/20260308140530.9ab6d1445d0936467eab4aef@xxxxxxxxxxxxxxxxxxxx/
Please let me know if it should be removed here, and I will update the
patch,
Thanks for the review,
--breno