From: Ben Hutchings <ben@decadent.org.uk>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 7/7] liblockdep: Fix 'defined but not used' warning for init_utsname()
Date: Tue, 14 Jun 2016 21:49:09 +0100 [thread overview]
Message-ID: <20160614204909.GZ7555@decadent.org.uk> (raw)
In-Reply-To: <20160614204437.GS7555@decadent.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]
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>
---
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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
next prev parent reply other threads:[~2016-06-14 20:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 20:44 [PATCH 0/7] Fixes for liblockdep Ben Hutchings
2016-06-14 20:47 ` [PATCH 1/7] liblockdep: Fix undefined symbol prandom_u32 Ben Hutchings
2016-06-14 21:31 ` Sasha Levin
2016-06-14 20:47 ` [PATCH 2/7] liblockdep: Reduce MAX_LOCK_DEPTH to avoid overflowing lock_chain::depth Ben Hutchings
2016-06-14 21:13 ` Peter Zijlstra
2016-06-14 20:48 ` [PATCH 3/7] liblockdep: Define the ARRAY_SIZE() macro Ben Hutchings
2016-06-14 20:48 ` [PATCH 4/7] liblockdep: Enable -Wall by default Ben Hutchings
2016-06-14 20:48 ` [PATCH 5/7] liblockdep: Fix 'unused value' warnings Ben Hutchings
2016-06-14 20:49 ` [PATCH 6/7] liblockdep: Fix 'set but not used' warnings Ben Hutchings
2016-06-14 20:49 ` Ben Hutchings [this message]
2016-06-14 21:31 ` [PATCH 0/7] Fixes for liblockdep Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160614204909.GZ7555@decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=sasha.levin@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox