Re: [PATCH] mm: name the anonymous MMOP enum as enum mmop
From: David Hildenbrand (Arm)
Date: Thu Feb 12 2026 - 03:58:45 EST
On 2/11/26 22:54, Gregory Price 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>
---
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David