From: Andrew Morton Date: Wed, 20 Feb 2013 02:14:20 +0000 (+1100) Subject: memory-hotplug-do-not-allocate-pdgat-if-it-was-not-freed-when-offline-fix X-Git-Tag: next-20130220~1^2~525 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b5ae9b2f351ec317b04badf5cc4e9364bf793d3e;p=karo-tx-linux.git memory-hotplug-do-not-allocate-pdgat-if-it-was-not-freed-when-offline-fix fix warning when CONFIG_NEED_MULTIPLE_NODES=n Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Jiang Liu Cc: Jianguo Wu Cc: KOSAKI Motohiro Cc: Kamezawa Hiroyuki Cc: Lai Jiangshan Cc: Tang Chen Cc: Thomas Gleixner Cc: Wen Congyang Cc: Wu Jianguo Cc: Yasuaki Ishimatsu Cc: Randy Dunlap Signed-off-by: Andrew Morton --- diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 2bc92267fca7..c806abd78d0e 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1077,7 +1077,8 @@ out: int __ref add_memory(int nid, u64 start, u64 size) { pg_data_t *pgdat = NULL; - int new_pgdat = 0, new_node = 0; + bool new_pgdat; + bool new_node; struct resource *res; int ret; @@ -1088,8 +1089,8 @@ int __ref add_memory(int nid, u64 start, u64 size) if (!res) goto out; - new_pgdat = NODE_DATA(nid) ? 0 : 1; - new_node = node_online(nid) ? 0 : 1; + new_pgdat = (NODE_DATA(nid) == NULL); + new_node = !node_online(nid); if (new_node) { pgdat = hotadd_new_pgdat(nid, start); ret = -ENOMEM;