mm: page_alloc: squash page_is_consistent()
authorKefeng Wang <wangkefeng.wang@huawei.com>
Tue, 16 May 2023 06:38:13 +0000 (14:38 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 9 Jun 2023 23:25:23 +0000 (16:25 -0700)
Squash the page_is_consistent() into bad_range() as there is only one
caller.

Link: https://lkml.kernel.org/r/20230516063821.121844-6-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Iurii Zaikin <yzaikin@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c

index 34a9fe93489106364655fe4c7eee164bd329291e..ce0d81686de362a7ca2269205e842a8d9497009e 100644 (file)
@@ -517,13 +517,6 @@ static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
        return ret;
 }
 
-static int page_is_consistent(struct zone *zone, struct page *page)
-{
-       if (zone != page_zone(page))
-               return 0;
-
-       return 1;
-}
 /*
  * Temporary debugging check for pages not lying within a given zone.
  */
@@ -531,7 +524,7 @@ static int __maybe_unused bad_range(struct zone *zone, struct page *page)
 {
        if (page_outside_zone_boundaries(zone, page))
                return 1;
-       if (!page_is_consistent(zone, page))
+       if (zone != page_zone(page))
                return 1;
 
        return 0;