Skip to content

Commit 3172e5e

Browse files
osalvadorvilardagatorvalds
authored andcommitted
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>
1 parent 4fbce63 commit 3172e5e

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

‎drivers/base/node.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,7 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, void *arg)
404404
int ret, nid = *(int *)arg;
405405
unsigned long pfn, sect_start_pfn, sect_end_pfn;
406406

407-
if (!mem_blk)
408-
return -EFAULT;
409-
410407
mem_blk->nid = nid;
411-
if (!node_online(nid))
412-
return 0;
413408

414409
sect_start_pfn = section_nr_to_pfn(mem_blk->start_section_nr);
415410
sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr);

0 commit comments

Comments
 (0)