Function subsection_map_init() is only used in free_area_init() in the loop of for_each_mem_pfn_range(). And we are sure in each iteration of for_each_mem_pfn_range(), start_pfn < end_pfn. So nr_pages is not possible to be 0 and we can remove the check. Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> CC: Mike Rapoport (IBM) <rppt@xxxxxxxxxx> --- mm/sparse.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index de40b2c73406..f56701873ce8 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -195,9 +195,6 @@ void __init subsection_map_init(unsigned long pfn, unsigned long nr_pages) int end_sec = pfn_to_section_nr(pfn + nr_pages - 1); unsigned long nr, start_sec = pfn_to_section_nr(pfn); - if (!nr_pages) - return; - for (nr = start_sec; nr <= end_sec; nr++) { struct mem_section *ms; unsigned long pfns; -- 2.34.1