public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
* [PATCH v4] mm/page_alloc: Simplify free_page_is_bad by removing free_page_is_bad_report
@ 2025-03-28  1:20 Ye Liu
  0 siblings, 0 replies; only message in thread
From: Ye Liu @ 2025-03-28  1:20 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Ye Liu, Anshuman Khandual, Oscar Salvador

From: Ye Liu <liuye@kylinos.cn>

Refactor free_page_is_bad() to call bad_page() directly, removing the 
intermediate free_page_is_bad_report(). This reduces unnecessary 
indirection, improving code clarity and maintainability without changing 
functionality.

Signed-off-by: Ye Liu <liuye@kylinos.cn>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>

---
V4: Simplify commit information.
V3: Delete 'This patch'.
V2: Simplify the code by removing unnecessary line breaks.
---
 mm/page_alloc.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 61d6a3b1b286..60c54ba78a11 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -933,19 +933,13 @@ static const char *page_bad_reason(struct page *page, unsigned long flags)
 	return bad_reason;
 }
 
-static void free_page_is_bad_report(struct page *page)
-{
-	bad_page(page,
-		 page_bad_reason(page, PAGE_FLAGS_CHECK_AT_FREE));
-}
-
 static inline bool free_page_is_bad(struct page *page)
 {
 	if (likely(page_expected_state(page, PAGE_FLAGS_CHECK_AT_FREE)))
 		return false;
 
 	/* Something has gone sideways, find it */
-	free_page_is_bad_report(page);
+	bad_page(page, page_bad_reason(page, PAGE_FLAGS_CHECK_AT_FREE));
 	return true;
 }
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-28  1:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-28  1:20 [PATCH v4] mm/page_alloc: Simplify free_page_is_bad by removing free_page_is_bad_report Ye Liu

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