Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Ye Liu and committed by
Andrew Morton
3a531a99 cf42d4cc

+1 -7
+1 -7
mm/page_alloc.c
··· 934 934 return bad_reason; 935 935 } 936 936 937 - static void free_page_is_bad_report(struct page *page) 938 - { 939 - bad_page(page, 940 - page_bad_reason(page, PAGE_FLAGS_CHECK_AT_FREE)); 941 - } 942 - 943 937 static inline bool free_page_is_bad(struct page *page) 944 938 { 945 939 if (likely(page_expected_state(page, PAGE_FLAGS_CHECK_AT_FREE))) 946 940 return false; 947 941 948 942 /* Something has gone sideways, find it */ 949 - free_page_is_bad_report(page); 943 + bad_page(page, page_bad_reason(page, PAGE_FLAGS_CHECK_AT_FREE)); 950 944 return true; 951 945 } 952 946