linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/sparse: remove redundant judgments from macro for_each_present_section_nr
@ 2023-07-07  6:05 liuq
  2023-07-07 15:17 ` [PATCH] mm/sparse: remove redundant judgement " Markus Elfring
  0 siblings, 1 reply; 2+ messages in thread
From: liuq @ 2023-07-07  6:05 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, liuq

The next_present_section_nr function has already ensured
that 'section_nr<=__highest_present_section_nr',
so this conditional judgment is removed.

Signed-off-by: liuq <liuq131@chinatelecom.cn>
---
 mm/sparse.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index 297a8b772e8d..77d91e565045 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -172,8 +172,7 @@ static void __section_mark_present(struct mem_section *ms,
 
 #define for_each_present_section_nr(start, section_nr)		\
 	for (section_nr = next_present_section_nr(start-1);	\
-	     ((section_nr != -1) &&				\
-	      (section_nr <= __highest_present_section_nr));	\
+	     section_nr != -1;								\
 	     section_nr = next_present_section_nr(section_nr))
 
 static inline unsigned long first_present_section_nr(void)
-- 
2.27.0



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

* Re: [PATCH] mm/sparse: remove redundant judgement from macro for_each_present_section_nr
  2023-07-07  6:05 [PATCH] mm/sparse: remove redundant judgments from macro for_each_present_section_nr liuq
@ 2023-07-07 15:17 ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2023-07-07 15:17 UTC (permalink / raw)
  To: liuq131, linux-mm, kernel-janitors, Andrew Morton; +Cc: LKML

> The next_present_section_nr function has already ensured
> that 'section_nr<=__highest_present_section_nr',
> so this conditional judgment is removed.

Please choose an imperative change suggestion.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.4#n94


> Signed-off-by: liuq <liuq131@chinatelecom.cn>

Would a more unique real name be more appropriate here?

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.4#n411

Regards,
Markus


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

end of thread, other threads:[~2023-07-07 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-07  6:05 [PATCH] mm/sparse: remove redundant judgments from macro for_each_present_section_nr liuq
2023-07-07 15:17 ` [PATCH] mm/sparse: remove redundant judgement " Markus Elfring

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