Re: [PATCH] mm: name the anonymous MMOP enum as enum mmop
From: Jonathan Cameron
Date: Thu Feb 19 2026 - 06:19:04 EST
On Wed, 11 Feb 2026 16:54:47 -0500
Gregory Price <gourry@xxxxxxxxxx> wrote:
> Give the MMOP enum (MMOP_OFFLINE, MMOP_ONLINE, etc) a proper type
> name so the compiler can help catch invalid values being assigned to
> variables of this type.
>
> Leave the existing functions returning int alone to allow for
> value-or-error pattern to remain unchanged without churn.
>
> mmop_default_online_type is left as int because it uses the -1
> sentinal value to signal it hasn't been initialized yet.
>
> Keep the uint8_t buffer in offline_and_remove_memory() as-is for
> space efficiency, with an explicit cast when we consume the value.
>
> Move the enum definition before the CONFIG_MEMORY_HOTPLUG guard so
> it is unconditionally available for struct memory_block in memory.h.
>
> No functional change.
>
> Link: https://lore.kernel.org/linux-mm/3424eba7-523b-4351-abd0-3a888a3e5e61@xxxxxxxxxx/
> Suggested-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>
> Suggested-by: "David Hildenbrand (arm)" <david@xxxxxxxxxx>
> Signed-off-by: Gregory Price <gourry@xxxxxxxxxx>
Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>
Thanks for cleaning this up!
J