]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm/page_alloc: replace flag check with PageHWPoison() in check_new_page_bad()
authorYe Liu <liuye@kylinos.cn>
Thu, 20 Mar 2025 06:33:46 +0000 (14:33 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 1 Apr 2025 22:17:10 +0000 (15:17 -0700)
This patch replaces the direct check for the __PG_HWPOISON flag with the
PageHWPoison() macro, improving code readability and maintaining
consistency with other parts of the memory management code.

Link: https://lkml.kernel.org/r/20250320063346.489030-1-ye.liu@linux.dev
Signed-off-by: Ye Liu <liuye@kylinos.cn>
Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c

index 37d111184eeebdadad987e376773a958442baa60..e892a55b471cd263a4c7e3dd7d1421a9eb09578a 100644 (file)
@@ -1593,7 +1593,7 @@ static __always_inline void page_del_and_expand(struct zone *zone,
 
 static void check_new_page_bad(struct page *page)
 {
-       if (unlikely(page->flags & __PG_HWPOISON)) {
+       if (unlikely(PageHWPoison(page))) {
                /* Don't complain about hwpoisoned pages */
                if (PageBuddy(page))
                        __ClearPageBuddy(page);