Skip to content

Commit 6e259e7

Browse files
akpm00torvalds
authored andcommitted
drivers/base/node.c: switch to register_hotmemory_notifier()
Squishes a warning which my change to hotplug_memory_notifier() added. I want to keep that warning, because it is punishment for failnig to check the hotplug_memory_notifier() return value. Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3ac38fa commit 6e259e7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎drivers/base/node.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/mm.h>
88
#include <linux/memory.h>
99
#include <linux/vmstat.h>
10+
#include <linux/notifier.h>
1011
#include <linux/node.h>
1112
#include <linux/hugetlb.h>
1213
#include <linux/compaction.h>
@@ -683,8 +684,11 @@ static int __init register_node_type(void)
683684

684685
ret = subsys_system_register(&node_subsys, cpu_root_attr_groups);
685686
if (!ret) {
686-
hotplug_memory_notifier(node_memory_callback,
687-
NODE_CALLBACK_PRI);
687+
static struct notifier_block node_memory_callback_nb = {
688+
.notifier_call = node_memory_callback,
689+
.priority = NODE_CALLBACK_PRI,
690+
};
691+
register_hotmemory_notifier(&node_memory_callback_nb);
688692
}
689693

690694
/*

0 commit comments

Comments
 (0)