mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
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>
This commit is contained in:
parent
cf42d4cccf
commit
3a531a9939
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user