diff options
author | Ye Liu <liuye@kylinos.cn> | 2025-03-28 09:20:31 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2025-05-11 17:48:09 -0700 |
commit | 3a531a9939623e13cf798e9ef5e7edd3e74fe733 (patch) | |
tree | 0a43159012fab20c5d6b64ed6f0be4d5d7a69eaa | |
parent | cf42d4cccf0d01e375175393776a16dc47b9996f (diff) |
mm/page_alloc: simplify free_page_is_bad by removing free_page_is_bad_report
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.
Link: https://lkml.kernel.org/r/20250328012031.1204993-1-ye.liu@linux.dev
Signed-off-by: Ye Liu <liuye@kylinos.cn>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | mm/page_alloc.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1ee0e8265888..b8c15d572f2d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -934,19 +934,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; } |