From: Wei Yang <richard.weiyang@gmail.com>
To: rppt@kernel.org, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, Wei Yang <richard.weiyang@gmail.com>
Subject: [PATCH 1/4] mm/sparse: nr_pages won't be 0
Date: Wed, 19 Jun 2024 01:06:09 +0000 [thread overview]
Message-ID: <20240619010612.20740-1-richard.weiyang@gmail.com> (raw)
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
next reply other threads:[~2024-06-19 1:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 1:06 Wei Yang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240619010612.20740-1-richard.weiyang@gmail.com \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=rppt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).