Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: change type of parameter for memory_notify

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>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Omar Sandoval <osandov@osandov.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Israel Batista and committed by
Andrew Morton
ed1f8855 8bc7ba3d

+4 -4
+2 -2
drivers/base/memory.c
··· 204 204 return sysfs_emit(buf, "%s\n", output); 205 205 } 206 206 207 - int memory_notify(unsigned long val, void *v) 207 + int memory_notify(enum memory_block_state state, void *v) 208 208 { 209 - return blocking_notifier_call_chain(&memory_chain, val, v); 209 + return blocking_notifier_call_chain(&memory_chain, state, v); 210 210 } 211 211 212 212 #if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_MEMORY_HOTPLUG)
+2 -2
include/linux/memory.h
··· 141 141 static inline void unregister_memory_notifier(struct notifier_block *nb) 142 142 { 143 143 } 144 - static inline int memory_notify(unsigned long val, void *v) 144 + static inline int memory_notify(enum memory_block_state state, void *v) 145 145 { 146 146 return 0; 147 147 } ··· 165 165 struct memory_group *group); 166 166 void remove_memory_block_devices(unsigned long start, unsigned long size); 167 167 extern void memory_dev_init(void); 168 - extern int memory_notify(unsigned long val, void *v); 168 + extern int memory_notify(enum memory_block_state state, void *v); 169 169 extern struct memory_block *find_memory_block(unsigned long section_nr); 170 170 typedef int (*walk_memory_blocks_func_t)(struct memory_block *, void *); 171 171 extern int walk_memory_blocks(unsigned long start, unsigned long size,