[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <173506642348.399.12120028725569106884.tip-bot2@tip-bot2>
Date: Tue, 24 Dec 2024 18:53:43 -0000
From: "tip-bot2 for Andy Shevchenko" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Boqun Feng <boqun.feng@...il.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject:
[tip: locking/core] lockdep: Mark chain_hlock_class_idx() with __maybe_unused
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 8148fa2e022bae29f21bb9a2c4cc796334fd372b
Gitweb: https://git.kernel.org/tip/8148fa2e022bae29f21bb9a2c4cc796334fd372b
Author: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
AuthorDate: Mon, 09 Dec 2024 19:08:10 +02:00
Committer: Boqun Feng <boqun.feng@...il.com>
CommitterDate: Thu, 19 Dec 2024 13:57:53 -08:00
lockdep: Mark chain_hlock_class_idx() with __maybe_unused
When chain_hlock_class_idx() is unused, it prevents kernel builds with
clang, `make W=1` and CONFIG_WERROR=y, CONFIG_LOCKDEP=y and
CONFIG_PROVE_LOCKING=n:
kernel/locking/lockdep.c:435:28: error: unused function 'chain_hlock_class_idx' [-Werror,-Wunused-function]
Fix this by marking it with __maybe_unused.
See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
inline functions for W=1 build").
[Boqun: add more config information of the error]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Signed-off-by: Boqun Feng <boqun.feng@...il.com>
Link: https://lore.kernel.org/r/20241209170810.1485183-1-andriy.shevchenko@linux.intel.com
---
kernel/locking/lockdep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 2d8ec03..fe04a21 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -430,7 +430,7 @@ static inline u16 hlock_id(struct held_lock *hlock)
return (hlock->class_idx | (hlock->read << MAX_LOCKDEP_KEYS_BITS));
}
-static inline unsigned int chain_hlock_class_idx(u16 hlock_id)
+static inline __maybe_unused unsigned int chain_hlock_class_idx(u16 hlock_id)
{
return hlock_id & (MAX_LOCKDEP_KEYS - 1);
}
Powered by blists - more mailing lists