summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorOscar Salvador <osalvador@suse.de>2018-08-17 15:46:25 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-17 16:20:29 -0700
commit3172e5e61c8a78f690c50f221fdeedce35d0b1e4 (patch)
tree8d1696575a1269f7009cd0960181120e9811fc77 /drivers/base
parent4fbce633910ed80b135b84160a22b219080c8082 (diff)
downloadlinux-3172e5e61c8a78f690c50f221fdeedce35d0b1e4.tar.bz2
mm/memory_hotplug.c: drop unnecessary checks from register_mem_sect_under_node()
Callers of register_mem_sect_under_node() are always passing a valid memory_block (not NULL), so we can safely drop the check for NULL. In the same way, register_mem_sect_under_node() is only called in case the node is online, so we can safely remove that check as well. Link: http://lkml.kernel.org/r/20180622111839.10071-5-osalvador@techadventures.net Signed-off-by: Oscar Salvador <osalvador@suse.de> Reviewed-by: Pavel Tatashin <pasha.tatashin@oracle.com> Tested-by: Reza Arbab <arbab@linux.vnet.ibm.com> Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Pasha Tatashin <Pavel.Tatashin@microsoft.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/node.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 845d5523812b..1ac4c36e13bb 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -404,12 +404,7 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, void *arg)
int ret, nid = *(int *)arg;
unsigned long pfn, sect_start_pfn, sect_end_pfn;
- if (!mem_blk)
- return -EFAULT;
-
mem_blk->nid = nid;
- if (!node_online(nid))
- return 0;
sect_start_pfn = section_nr_to_pfn(mem_blk->start_section_nr);
sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr);