mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kernel/locking/lockdep.c: mark chainhashentry as __maybe_unused
@ 2016-02-03 22:05 Arnd Bergmann
  0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2016-02-03 22:05 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-arm-kernel, Arnd Bergmann, Mike Krinkin, Andrey Ryabinin,
	Ingo Molnar, Peter Zijlstra, Ingo Molnar, linux-kernel

The newly added chainhashentry() function is only use when
CONFIG_PROVE_LOCKING is enabled, otherwise we get a warning about it.

kernel/locking/lockdep.c:318:26: error: 'chainhashentry' defined but not used [-Werror=unused-function]

We could add another #ifdef or add __maybe_unused to avoid the warning,
this patch picks the second option.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a33a23c7def8 ("kernel/locking/lockdep.c: make lockdep initialize itself on demand")
---
 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 9269b1a74260..0d3c08d23946 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -315,7 +315,7 @@ static inline struct list_head *classhashentry(struct lockdep_subclass_key *key)
 
 static struct list_head __chainhash_table[CHAINHASH_SIZE];
 
-static struct list_head *chainhashentry(unsigned long chain)
+static __maybe_unused struct list_head * chainhashentry(unsigned long chain)
 {
 	if (unlikely(!lockdep_initialized))
 		lockdep_init();
-- 
2.7.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-03 22:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03 22:05 [PATCH] kernel/locking/lockdep.c: mark chainhashentry as __maybe_unused Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®