Skip to contentSkip to conversation

mm-change-type-of-state-in-struct-memory_block.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Nov 17, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: change type of state in struct memory_block
has been removed from the -mm tree. Its filename was
mm-change-type-of-state-in-struct-memory_block.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Israel Batista <[email protected]>
Subject: mm: change type of state in struct memory_block
Date: Wed, 29 Oct 2025 19:56:30 +0000 (UTC)

The state of a memory block should be restricted to values specified in the documentation of the memory hotplug API. However, since the state field in the memory_block struct was defined as an unsigned long, this restriction was not enforced at compile time.

With the introduction of the enum memory_block_state, it is now possible to incorporate the desired semantics in the field declaration and enforce these restrictions at compile time.

---

 drivers/base/memory.c  |    2 +-
 include/linux/memory.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/base/memory.c renamed from drivers/base/memory.c~mm-change-type-of-state-in-struct-memory_block +1 -1
@@ -198,7 +198,7 @@ static ssize_t state_show(struct device
 		break;
 	default:
 		WARN_ON(1);
-		return sysfs_emit(buf, "ERROR-UNKNOWN-%ld\n", mem->state);
+		return sysfs_emit(buf, "ERROR-UNKNOWN-%d\n", mem->state);
 	}
 
 	return sysfs_emit(buf, "%s\n", output);
include/linux/memory.h renamed from include/linux/memory.h~mm-change-type-of-state-in-struct-memory_block +1 -1
@@ -78,7 +78,7 @@ enum memory_block_state {
 
 struct memory_block {
 	unsigned long start_section_nr;
-	unsigned long state;		/* serialized by the dev->lock */
+	enum memory_block_state state;	/* serialized by the dev->lock */
 	int online_type;		/* for passing data to online routine */
 	int nid;			/* NID for this memory block */
 	/*

_

Patches currently in -mm which might be from [email protected] are