From patchwork Thu Sep 5 17:15:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13792747 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 BC253CD6E58 for ; Thu, 5 Sep 2024 17:16:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 542916B0089; Thu, 5 Sep 2024 13:16:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CB736B008A; Thu, 5 Sep 2024 13:16:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36CE66B008C; Thu, 5 Sep 2024 13:16:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 1A1F26B0089 for ; Thu, 5 Sep 2024 13:16:05 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id ACF6DA99BF for ; Thu, 5 Sep 2024 17:16:04 +0000 (UTC) X-FDA: 82531337448.03.E7091AA Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by imf27.hostedemail.com (Postfix) with ESMTP id 530A640014 for ; Thu, 5 Sep 2024 17:16:02 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=S++84ZFY; spf=none (imf27.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 198.175.65.9) smtp.mailfrom=andriy.shevchenko@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725556513; a=rsa-sha256; cv=none; b=L88sjUEDR2JuguhGRL2hYml9s2T36HGgmrwtzPNXj501wPRK7ujSFsNCPOk1tdZ2siPOfw LiXj8O9FppdP9mXXe6STEYRs5Rv/Q9WFW4LdSfxf3CjNK+okWD5TGfUhEptvRo+iDlCP/4 FQ5zIKNxIppKl67eyv38aAg07ejPfEo= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=S++84ZFY; spf=none (imf27.hostedemail.com: domain of andriy.shevchenko@linux.intel.com has no SPF policy when checking 198.175.65.9) 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=1725556513; 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=c0tvTO+2jtBRcBC+LoRDkzy5I2Iq5Rlm1PoHMipz7Z0=; b=nBPQ4bbYeHinsklnoWy3CMIdqboFjXzNkvix5gDiLM4/epk+2/otydP8A1/M2Bz46sc9o2 PyldUh1j1VGzR3uCh4OlttcKXoL8P7fRSMfyLRE1JLRzel8rt/raNay1UYvDVbFu6JfJkt qLQCxiOG2QUBSlngoG8Ps95gt3QxRzk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725556563; x=1757092563; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=HprEm+25bMv9ipc0ur/k025rHi0KLLQza4pA0qsXpJo=; b=S++84ZFYMDhRUILnimSukx7ndonxgGsjeI4+CZRHJwWE8sAZAIieVOm+ S13R0Df81AOVtbmO2PgIMkm7+ukljX3nK0bhUaGFP+GR9LFMU+F0o1MMC IH850dhQSfAxFVPq+2KNNGBXUeXlyoXf/0RBs5TzH28BVwMka0SLkCEHe 6LoSYW59mYOZsljaCxNQipdvoebzpfOg+c+709BFzzSmKZqJiViLEfbRg 3/QKjpfWXIk1hvXeismPB+hkH4lvoc2AVw9HhyX0tmUoXzDDffYnFkfVL zaz1LxTM4zHe/9/uc9q0JS1EvGAGTTqgZeuyCq5B5cEzKaK4MpjBR6gBp A==; X-CSE-ConnectionGUID: ZO+RmViTSDWCfdUhhQf3hQ== X-CSE-MsgGUID: 2YfidrE8S2my2HcHYCMo+Q== X-IronPort-AV: E=McAfee;i="6700,10204,11186"; a="46820336" X-IronPort-AV: E=Sophos;i="6.10,205,1719903600"; d="scan'208";a="46820336" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2024 10:16:01 -0700 X-CSE-ConnectionGUID: jG0AhIh3TROoGs10VT+HdA== X-CSE-MsgGUID: NJo70IV1TDe5tF7dhehhQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,205,1719903600"; d="scan'208";a="70260947" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa004.fm.intel.com with ESMTP; 05 Sep 2024 10:15:59 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 8BE3531E; Thu, 05 Sep 2024 20:15:57 +0300 (EEST) From: Andy Shevchenko To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Cc: Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andy Shevchenko Subject: [PATCH v1 1/1] mm/page_alloc: Mark has_unaccepted_memory() with __maybe_unused Date: Thu, 5 Sep 2024 20:15:53 +0300 Message-ID: <20240905171553.275054-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac MIME-Version: 1.0 X-Stat-Signature: eqiick71374qs7ds5fjuqwifdnm1sep4 X-Rspamd-Queue-Id: 530A640014 X-Rspam-User: X-Rspamd-Server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PPodh+I5Jpz50lIJN3GlQGShdfW8XZDFgPo7YVXqeB9iPRHWBPLNd7hd8wENU/1g2u1Wlsd3RS8deTfVy1X0CxzIlHHeWi9f1hWJVUsFvDDy3VTnHzrXv5CWUL5jWT05adciZ1UO61y42Ss0VDkR70HtGxLBlFtlK2P25KPTla5YN7M1PiukQ== 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: When has_unaccepted_memory() is unused, it prevents kernel builds with clang, `make W=1` and CONFIG_WERROR=y: mm/page_alloc.c:7036:20: error: unused function 'has_unaccepted_memory' [-Werror,-Wunused-function] 7036 | static inline bool has_unaccepted_memory(void) | ^~~~~~~~~~~~~~~~~~~~~ Fix this by marking it with __maybe_unused (all cases for the sake of symmetry). See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build"). Signed-off-by: Andy Shevchenko Reported-by: Andy Shevchenko --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c565de8f48e9..3b47f1b17ae5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6990,7 +6990,7 @@ static bool cond_accept_memory(struct zone *zone, unsigned int order) return ret; } -static inline bool has_unaccepted_memory(void) +static inline __maybe_unused bool has_unaccepted_memory(void) { return static_branch_unlikely(&zones_with_unaccepted_pages); } @@ -7033,7 +7033,7 @@ static bool cond_accept_memory(struct zone *zone, unsigned int order) return false; } -static inline bool has_unaccepted_memory(void) +static inline __maybe_unused bool has_unaccepted_memory(void) { return false; }