The patch titled Subject: mm/sparse: nr_pages won't be 0 has been added to the -mm mm-unstable branch. Its filename is mm-sparse-nr_pages-wont-be-0.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-sparse-nr_pages-wont-be-0.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Wei Yang <richard.weiyang@xxxxxxxxx> Subject: mm/sparse: nr_pages won't be 0 Date: Wed, 19 Jun 2024 01:06:09 +0000 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. Link: https://lkml.kernel.org/r/20240619010612.20740-1-richard.weiyang@xxxxxxxxx Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> Cc: Mike Rapoport (IBM) <rppt@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/sparse.c | 3 --- 1 file changed, 3 deletions(-) --- a/mm/sparse.c~mm-sparse-nr_pages-wont-be-0 +++ a/mm/sparse.c @@ -195,9 +195,6 @@ void __init subsection_map_init(unsigned int end_sec_nr = pfn_to_section_nr(pfn + nr_pages - 1); unsigned long nr, start_sec_nr = pfn_to_section_nr(pfn); - if (!nr_pages) - return; - for (nr = start_sec_nr; nr <= end_sec_nr; nr++) { struct mem_section *ms; unsigned long pfns; _ Patches currently in -mm which might be from richard.weiyang@xxxxxxxxx are mm-mm_initc-print-mem_init-info-after-defer_init-is-done.patch mm-mm_initc-simplify-logic-of-deferred__pages.patch mm-mm_initc-simplify-logic-of-deferred__pages-v2.patch mm-sparse-nr_pages-wont-be-0.patch mm-mm_initc-move-build-check-on-max_zonelists-out-of-ifdef.patch mm-page_alloc-fix-a-typo-in-comment-about-gfp-flag.patch mm-page_alloc-reword-the-comment-of-buddy_merge_likely.patch