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

mm: page_alloc: squash page_is_consistent()

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>

authored by

Kefeng Wang and committed by
Andrew Morton
5b855aa3 e9aae170

+1 -8
+1 -8
mm/page_alloc.c
··· 517 517 return ret; 518 518 } 519 519 520 - static int page_is_consistent(struct zone *zone, struct page *page) 521 - { 522 - if (zone != page_zone(page)) 523 - return 0; 524 - 525 - return 1; 526 - } 527 520 /* 528 521 * Temporary debugging check for pages not lying within a given zone. 529 522 */ ··· 524 531 { 525 532 if (page_outside_zone_boundaries(zone, page)) 526 533 return 1; 527 - if (!page_is_consistent(zone, page)) 534 + if (zone != page_zone(page)) 528 535 return 1; 529 536 530 537 return 0;