mm/memory_hotplug: clean up try_offline_node
authorMiaohe Lin <linmiaohe@huawei.com>
Wed, 16 Feb 2022 04:31:32 +0000 (15:31 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 17 Feb 2022 03:46:38 +0000 (14:46 +1100)
commit41b37ef315901ae5dcfac97f9b4845925c301184
tree76dfa1e9e47b569044668eeeb38f2d0d382e5e92
parent8eeb155213950af4a52ad3e1011d40ac8da2e0dc
mm/memory_hotplug: clean up try_offline_node

We can use helper macro node_spanned_pages to check whether node spans
pages.  And we can change the parameter of check_cpu_on_node to nid as
that's what it really cares.  Thus we can further get rid of the local
variable pgdat and improve the readability a bit.

Link: https://lkml.kernel.org/r/20220207133643.23427-4-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/memory_hotplug.c