OSDN Git Service

mm/memory_hotplug: clean up try_offline_node
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 22 Mar 2022 21:47:22 +0000 (14:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2022 22:57:10 +0000 (15:57 -0700)
commitb27340a5bda4e35453d186e25622bacc3cf595c2
tree48ad0edf8d44fdf64b7f742a10bede49bb0459f5
parentd6aad2016a3f902153d7b8b7e02da2c7c50c10a4
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: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory_hotplug.c