diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2017-05-25 08:58:39 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-06-05 03:28:06 -0400 |
commit | 1baa75406ecc2d77c9e6ecf45a707838a5bf7f29 (patch) | |
tree | 7a12f9793c254b9b20513132f3ddbd5b773b2080 /tools/lib | |
parent | b016d870cadae31d7c5eb2eef794d2e733f6595c (diff) |
tools/lib/lockdep: Fix 'defined but not used' warning for init_utsname()
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>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/lockdep/lockdep.c | 10 | ||||
-rw-r--r-- | tools/lib/lockdep/uinclude/linux/lockdep.h | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/tools/lib/lockdep/lockdep.c b/tools/lib/lockdep/lockdep.c index 443acb11f907..209f967dedaa 100644 --- a/tools/lib/lockdep/lockdep.c +++ b/tools/lib/lockdep/lockdep.c | |||
@@ -12,4 +12,14 @@ u32 prandom_u32(void) | |||
12 | abort(); | 12 | abort(); |
13 | } | 13 | } |
14 | 14 | ||
15 | static struct new_utsname *init_utsname(void) | ||
16 | { | ||
17 | static struct new_utsname n = (struct new_utsname) { | ||
18 | .release = "liblockdep", | ||
19 | .version = LIBLOCKDEP_VERSION, | ||
20 | }; | ||
21 | |||
22 | return &n; | ||
23 | } | ||
24 | |||
15 | #include "../../../kernel/locking/lockdep.c" | 25 | #include "../../../kernel/locking/lockdep.c" |
diff --git a/tools/lib/lockdep/uinclude/linux/lockdep.h b/tools/lib/lockdep/uinclude/linux/lockdep.h index d1079034a14d..c157242e0417 100644 --- a/tools/lib/lockdep/uinclude/linux/lockdep.h +++ b/tools/lib/lockdep/uinclude/linux/lockdep.h | |||
@@ -44,16 +44,6 @@ static inline int debug_locks_off(void) | |||
44 | #define atomic_t unsigned long | 44 | #define atomic_t unsigned long |
45 | #define atomic_inc(x) ((*(x))++) | 45 | #define atomic_inc(x) ((*(x))++) |
46 | 46 | ||
47 | static struct new_utsname *init_utsname(void) | ||
48 | { | ||
49 | static struct new_utsname n = (struct new_utsname) { | ||
50 | .release = "liblockdep", | ||
51 | .version = LIBLOCKDEP_VERSION, | ||
52 | }; | ||
53 | |||
54 | return &n; | ||
55 | } | ||
56 | |||
57 | #define print_tainted() "" | 47 | #define print_tainted() "" |
58 | #define static_obj(x) 1 | 48 | #define static_obj(x) 1 |
59 | 49 | ||