[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160614204909.GZ7555@decadent.org.uk>
Date: Tue, 14 Jun 2016 21:49:09 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: Sasha Levin <sasha.levin@...cle.com>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 7/7] liblockdep: 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@...adent.org.uk>
---
tools/lib/lockdep/lockdep.c | 10 ++++++++++
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 a0a2e3a266af..513140ea8a58 100644
--- a/tools/lib/lockdep/lockdep.c
+++ b/tools/lib/lockdep/lockdep.c
@@ -5,4 +5,14 @@
#define hlist_add_head_rcu hlist_add_head
#define hlist_del_rcu hlist_del
+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"
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)
#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
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)
Powered by blists - more mailing lists