Skip to contentSkip to conversation

mm/page_alloc: Simplify free_page_is_bad by removing free_page_is_bad_report

PATCH Applied Ye Liu 1 participant 1 message Mar 28, 2025

Subsystems (2)
lore
Share & tools
lore

Ye Liu

author
#0 lore raw

PATCH v4 1/1 mm/page_alloc: Simplify free_page_is_bad by removing free_page_is_bad_report

From: Ye Liu <[email protected]>

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.

---
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(-)
mm/page_alloc.c +1 -7
index 61d6a3b1b286..60c54ba78a11 100644
@@ -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;
 }
 
Signature · 1 line
2.25.1