From patchwork Tue Apr 23 16:14:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13640314 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1598C4345F for ; Tue, 23 Apr 2024 16:15:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 303FC6B012A; Tue, 23 Apr 2024 12:15:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B4E36B012B; Tue, 23 Apr 2024 12:15:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 17CE06B012C; Tue, 23 Apr 2024 12:15:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id EBEE06B012A for ; Tue, 23 Apr 2024 12:15:14 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 923A7C0EF8 for ; Tue, 23 Apr 2024 16:15:14 +0000 (UTC) X-FDA: 82041296148.27.FE6C74E Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by imf29.hostedemail.com (Postfix) with ESMTP id 2FD3E120012 for ; Tue, 23 Apr 2024 16:15:11 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ifvQO6n8; spf=none (imf29.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 192.198.163.8) smtp.mailfrom=andriy.shevchenko@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713888912; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=UOzz5LZvu0xyu0KwT8IIRpLA9Kk9gl1H7C+3E2KXPWY=; b=ZZjbncm1XDFw6e4mfmL8mkzyeBeEA9nHv9Ns3E0dRB/Xqy1Fs+4BNbKXfqDpmiQtUQgbEA OYxiwx7BXfxlc4IgkDr/Rdg5idlTtuhqS1k2KdQxhUfedKOZ17eMrCWE8NeR+XxxJ2VMiz wVzPv9FLlfVSy5s1BBmHetR+KiUTEYA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713888912; a=rsa-sha256; cv=none; b=2oAfNlOrlt/FjXCQ7AIlqpaZypRRtOa5F+Jkj1VP/nMPstkSDjnhvDdtco00eIjWr7I5vQ rWu1G9/10H6+0BhfHrJbUzl1R5tvz2LnIhOfJaG0D1w17j0Jphqkd5IGO1LTRd/3/zXvmP rGBwPxqHOJvsjFqogP8eDh50rV5L0Co= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ifvQO6n8; spf=none (imf29.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 192.198.163.8) smtp.mailfrom=andriy.shevchenko@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713888912; x=1745424912; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bHyjoHr77jVo9CAvNPXLHXKFZ3NRGRlYQsxzS10sZsU=; b=ifvQO6n8gOLNoC0uMFbdpx9jSJlYkHukzTSw6FrkfAAPNjKkAb0qNxIq HSvvXg2Hhv4Q4kglzSM25PUod5fkMmWKm40+cAeVE5oTXi6hpDeBOG4QV tpPhSvODqnmPqp+As/em468nf7ZLiUuteJXfaEFxfON+0z+YFyYmzTYcr MV4Q9QbNSjUF72noZ13oMANk8UplSnH6rxG9SiJRCuwSTAh4b8vrA25/Z u7MAJWK91zYD6g6lN/FBc17aLrJr/eVm5yy2BEGDB30B/aKkYVmWUSCLg 03iZwp9Px1lcg9nx6dkY3kSDhEVXG+P2VQhqRhoMMEcyggY7WDnXbltg8 g==; X-CSE-ConnectionGUID: HkgxAvYWTGanyMyqd60YZw== X-CSE-MsgGUID: GrgZ3K0FQOuVowfmGbzPww== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="27000217" X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="27000217" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 09:15:11 -0700 X-CSE-ConnectionGUID: MO9KiCQiTWCU2KBSZu54Pw== X-CSE-MsgGUID: Qv7a4b49SpiGmNjU2OqtFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="24465567" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 23 Apr 2024 09:15:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3C0D3192; Tue, 23 Apr 2024 19:15:08 +0300 (EEST) From: Andy Shevchenko To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Rasmus Villemoes , Andy Shevchenko Subject: [PATCH v2 1/1] mm: page_alloc: Avoid defining unused function Date: Tue, 23 Apr 2024 19:14:43 +0300 Message-ID: <20240423161506.2637177-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2FD3E120012 X-Rspam-User: X-Stat-Signature: z9ynxfh9o5n5ui3gecu9bhopd3pwq946 X-HE-Tag: 1713888911-246092 X-HE-Meta: U2FsdGVkX18WzaRAVKWgCiPLFP15s/rqIuMwlD588UvQii/12Wf1iAzDZ9COmqvFce9BNWEQxr0NPaSB+fbJU2THRCv7jTXpLrwZpPDqKuyfHp12zAimwE0BgAucg+dx5lFpeQisVa8OPxsUDyBQ8uBf1J3jgUpF+TIHPHNDQuRNhckKJBE3gw4AQLs7MbGq0vC2N0cNgR0VU0pwDkBw4o+MW5DYKthk/U+1S1MKvbKdLdeL3ru1mIC0l6jtrlAcDS2txGf8dsLYFVAHjwEWYIgqyR2UoBXfJ0G6qws9aWtu93bk1UzCFu4Tk4zyA2RDl4e6yqZxjxlcxCa/jbmbAeRCoAE98AbD8JMyAt6bqesLHQvnQNeq3OrnOn92Z/ldOCncwVXQ4sK85mtMc4cuD+qKTcSN7nHiUYrPQ8lRHarp/sy9JC3LetNoGE+EsA7/tGn0HUASAAB4XuXfUmZeSsxRIYKRvlTOB51Zgu/Y/lPVRq+6rB5KsZr8rEIKoOp7D6A4Hmk+ep3NFlRjZUJmTe2myva7yvsWw7/O54If1ahb1kXhXGLEXTRtGJhdQ7vNSUiwCxOjRJDLTyvR2rUF0WsyX8+mtaT6hZL16ABbA/F8gXMGSbUabEx+7aZC+wmbg12t1X3MmWSqWpsLtw42D94rmKteHDUbdVGom9APOSLFbH55kyAg2XHig+06/yUhJ4tmU/d+p2vIPHcpemMvfiPSEtQWgHE5JrGCJHJNMgaQ6kz8x9hr/qNBXFDUtz4Q6igoVOEMSG3IuQv8u3Hk5cySv4LTCWyU3bCHSw/yS6WJCl4crisI7y4adQmwYJiBJgpMHJMpzs3/9WD6VcpHMG11Ynhlvhjb0VVQQEINRhfp/V19NQnu5T9dQsiIUfk8lUlHoS36/cC6/4eZRV1U83XukK9mUZia X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In some configurations I got mm/page_alloc.c:656:20: warning: unused function 'add_to_free_list' [-Wunused-function] Becuase the only user is guarged with a certain ifdeffery, do the same for add_to_free_list(). Signed-off-by: Andy Shevchenko Acked-by: Johannes Weiner Reviewed-by: Miaohe Lin --- v2: moved the function down to the respective ifdeffery block (Liam) mm/page_alloc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 33d4a1be927b..cd584aace6bf 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -653,14 +653,6 @@ static inline void __add_to_free_list(struct page *page, struct zone *zone, area->nr_free++; } -static inline void add_to_free_list(struct page *page, struct zone *zone, - unsigned int order, int migratetype, - bool tail) -{ - __add_to_free_list(page, zone, order, migratetype, tail); - account_freepages(zone, 1 << order, migratetype); -} - /* * Used for pages which are on another list. Move the pages to the tail * of the list - so the moved pages won't immediately be considered for @@ -6776,6 +6768,14 @@ bool is_free_buddy_page(const struct page *page) EXPORT_SYMBOL(is_free_buddy_page); #ifdef CONFIG_MEMORY_FAILURE +static inline void add_to_free_list(struct page *page, struct zone *zone, + unsigned int order, int migratetype, + bool tail) +{ + __add_to_free_list(page, zone, order, migratetype, tail); + account_freepages(zone, 1 << order, migratetype); +} + /* * Break down a higher-order page in sub-pages, and keep our target out of * buddy allocator.