Re: [PATCH] mm: name the anonymous MMOP enum as enum mmop

From: Davidlohr Bueso

Date: Thu Feb 12 2026 - 13:13:46 EST


On Wed, 11 Feb 2026, 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.

Reviewed-by: Davidlohr Bueso <dave@xxxxxxxxxxxx>