From 5ed867037eb1f15b7e8cc92497671fd4b3864e4a Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Mon, 23 Sep 2019 15:36:33 -0700 Subject: mm/sparse.c: remove NULL check in clear_hwpoisoned_pages() There is no possibility for memmap to be NULL in the current codebase. This check was added in commit 95a4774d055c ("memory-hotplug: update mce_bad_pages when removing the memory") where memmap was originally inited to NULL, and only conditionally given a value. The code that could have passed a NULL has been removed by commit ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug"), so there is no longer a possibility that memmap can be NULL. Link: http://lkml.kernel.org/r/20190829035151.20975-1-alastair@d-silva.org Signed-off-by: Alastair D'Silva Acked-by: Michal Hocko Reviewed-by: David Hildenbrand Cc: Mike Rapoport Cc: Wei Yang Cc: Qian Cai Cc: Alexander Duyck Cc: Logan Gunthorpe Cc: Baoquan He Cc: Balbir Singh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/sparse.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'mm/sparse.c') diff --git a/mm/sparse.c b/mm/sparse.c index d7af5cfdc810..bf32de9e666b 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -896,9 +896,6 @@ static void clear_hwpoisoned_pages(struct page *memmap, int nr_pages) { int i; - if (!memmap) - return; - /* * A further optimization is to have per section refcounted * num_poisoned_pages. But that would need more space per memmap, so -- cgit