mm/memory_hotplug: clean up try_offline_node
authorMiaohe Lin <linmiaohe@huawei.com>
Mon, 28 Feb 2022 23:01:38 +0000 (10:01 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 28 Feb 2022 23:01:38 +0000 (10:01 +1100)
commit5f9a9581b8326360bebdd95d59a88490e4b5c40a
treed4c78799e29d662c93a5c7e0e6b927b73a15ebec
parent8194d1551c72918209611d1e27633317e05fdb89
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