* + mm-change-type-of-parameter-for-memory_notify.patch added to mm-new branch
@ 2025-10-29 21:55 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-10-29 21:55 UTC (permalink / raw)
To: mm-commits, rppt, rdunlap, osandov, lorenzo.stoakes, david, linux,
akpm
The patch titled
Subject: mm: change type of parameter for memory_notify
has been added to the -mm mm-new branch. Its filename is
mm-change-type-of-parameter-for-memory_notify.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-change-type-of-parameter-for-memory_notify.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Israel Batista <linux@israelbatista.dev.br>
Subject: mm: change type of parameter for memory_notify
Date: Wed, 29 Oct 2025 19:56:32 +0000 (UTC)
memory_notify() is responsible for sending events related to memory
hotplugging to a notification queue. Since all the events must match one
of the values from the enum memory_block_state, it is appropriate to
change the function parameter type to make this condition explicit at
compile time.
Link: https://lkml.kernel.org/r/20251029195617.2210700-4-linux@israelbatista.dev.br
Signed-off-by: Israel Batista <linux@israelbatista.dev.br>
Cc: David Hildenbrand <david@redhat.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Omar Sandoval <osandov@osandov.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/base/memory.c | 4 ++--
include/linux/memory.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/base/memory.c~mm-change-type-of-parameter-for-memory_notify
+++ a/drivers/base/memory.c
@@ -204,9 +204,9 @@ static ssize_t state_show(struct device
return sysfs_emit(buf, "%s\n", output);
}
-int memory_notify(unsigned long val, void *v)
+int memory_notify(enum memory_block_state state, void *v)
{
- return blocking_notifier_call_chain(&memory_chain, val, v);
+ return blocking_notifier_call_chain(&memory_chain, state, v);
}
#if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_MEMORY_HOTPLUG)
--- a/include/linux/memory.h~mm-change-type-of-parameter-for-memory_notify
+++ a/include/linux/memory.h
@@ -141,7 +141,7 @@ static inline int register_memory_notifi
static inline void unregister_memory_notifier(struct notifier_block *nb)
{
}
-static inline int memory_notify(unsigned long val, void *v)
+static inline int memory_notify(enum memory_block_state state, void *v)
{
return 0;
}
@@ -165,7 +165,7 @@ int create_memory_block_devices(unsigned
struct memory_group *group);
void remove_memory_block_devices(unsigned long start, unsigned long size);
extern void memory_dev_init(void);
-extern int memory_notify(unsigned long val, void *v);
+extern int memory_notify(enum memory_block_state state, void *v);
extern struct memory_block *find_memory_block(unsigned long section_nr);
typedef int (*walk_memory_blocks_func_t)(struct memory_block *, void *);
extern int walk_memory_blocks(unsigned long start, unsigned long size,
_
Patches currently in -mm which might be from linux@israelbatista.dev.br are
mm-convert-memory-block-states-mem_-macros-to-enum.patch
mm-change-type-of-state-in-struct-memory_block.patch
mm-change-type-of-parameter-for-memory_notify.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-10-29 21:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 21:55 + mm-change-type-of-parameter-for-memory_notify.patch added to mm-new branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.