[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240905171553.275054-1-andriy.shevchenko@linux.intel.com>
Date: Thu, 5 Sep 2024 20:15:53 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev
Cc: Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 1/1] mm/page_alloc: Mark has_unaccepted_memory() with __maybe_unused
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 <andriy.shevchenko@...ux.intel.com>
---
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;
}
--
2.43.0.rc1.1336.g36b5255a03ac
Powered by blists - more mailing lists