linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] mm/sparse: nr_pages won't be 0
@ 2024-06-19  1:06 Wei Yang
  2024-06-19  1:06 ` [PATCH 2/4] mm/mm_init.c: move build check on MAX_ZONELISTS out of ifdef Wei Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Wei Yang @ 2024-06-19  1:06 UTC (permalink / raw)
  To: rppt, akpm; +Cc: linux-mm, Wei Yang

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@gmail.com>
CC: Mike Rapoport (IBM) <rppt@kernel.org>
---
 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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-23  7:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-19  1:06 [PATCH 1/4] mm/sparse: nr_pages won't be 0 Wei Yang
2024-06-19  1:06 ` [PATCH 2/4] mm/mm_init.c: move build check on MAX_ZONELISTS out of ifdef Wei Yang
2024-06-23  7:48   ` Mike Rapoport
2024-06-19  1:06 ` [PATCH 3/4] mm/page_alloc: fix a typo in comment about GFP flag Wei Yang
2024-06-23  7:50   ` Mike Rapoport
2024-06-19  1:06 ` [PATCH 4/4] mm/page_alloc: reword the comment of buddy_merge_likely() Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox