tools/lib/lockdep: Fix 'defined but not used' warning for init_utsname()
authorBen Hutchings <ben@decadent.org.uk>
Thu, 25 May 2017 12:58:39 +0000 (12:58 +0000)
committerIngo Molnar <mingo@kernel.org>
Mon, 5 Jun 2017 07:28:06 +0000 (09:28 +0200)
We define init_utsname() as static but not inline, resulting
in a warning for every source file that includes lockdep.h but
doesn't call it.

Since it is only used by lockdep.c, define it in there.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: a.p.zijlstra@chello.nl
Link: http://lkml.kernel.org/r/20170525130005.5947-8-alexander.levin@verizon.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
tools/lib/lockdep/lockdep.c
tools/lib/lockdep/uinclude/linux/lockdep.h

index 443acb11f907352887c90cd07389da4be836c418..209f967dedaa31e873da32424739e8833ba5939a 100644 (file)
@@ -12,4 +12,14 @@ u32 prandom_u32(void)
        abort();
 }
 
+static struct new_utsname *init_utsname(void)
+{
+       static struct new_utsname n = (struct new_utsname) {
+               .release = "liblockdep",
+               .version = LIBLOCKDEP_VERSION,
+       };
+
+       return &n;
+}
+
 #include "../../../kernel/locking/lockdep.c"
index d1079034a14d7f70de5b8faa64d1f4617cf279d2..c157242e0417427111249d9ec122d0e194bee0df 100644 (file)
@@ -44,16 +44,6 @@ static inline int debug_locks_off(void)
 #define atomic_t unsigned long
 #define atomic_inc(x) ((*(x))++)
 
-static struct new_utsname *init_utsname(void)
-{
-       static struct new_utsname n = (struct new_utsname) {
-               .release = "liblockdep",
-               .version = LIBLOCKDEP_VERSION,
-       };
-
-       return &n;
-}
-
 #define print_tainted() ""
 #define static_obj(x) 1