Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643712

[PATCH 07/15] liblockdep: Fix 'defined but not used' warning for init_utsname()

From alexander.levin@verizon.com
Newsgroups linux.kernel
Subject [PATCH 07/15] liblockdep: Fix 'defined but not used' warning for init_utsname()
Date 2017-05-18 02:20 +0200
Message-ID <tIhkB-1NU-5@gated-at.bofh.it> (permalink)
References <tIhaV-1Ks-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Ben Hutchings <ben@decadent.org.uk>

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>
---
 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 443acb11f907..209f967dedaa 100644
--- a/tools/lib/lockdep/lockdep.c
+++ b/tools/lib/lockdep/lockdep.c
@@ -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"
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
 
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 01/15] liblockdep: Fix undefined symbol prandom_u32 alexander.levin@verizon.com - 2017-05-18 02:10 +0200
  [PATCH 02/15] liblockdep: Reduce MAX_LOCK_DEPTH to avoid overflowing  lock_chain::depth alexander.levin@verizon.com - 2017-05-18 02:10 +0200
  [PATCH 10/15] tools: add install make target for liblockdep alexander.levin@verizon.com - 2017-05-18 02:10 +0200
  [PATCH 12/15] tools: liblockdep: fix compilation for 4.11 alexander.levin@verizon.com - 2017-05-18 02:10 +0200
  [PATCH 15/15] tools: liblockdep: Use LDFLAGS alexander.levin@verizon.com - 2017-05-18 02:10 +0200
  [PATCH 08/15] liblockdep: Remove -lpthread compiler option alexander.levin@verizon.com - 2017-05-18 02:10 +0200
  [PATCH 09/15] MAINTAINERS: update email for Sasha Levin alexander.levin@verizon.com - 2017-05-18 02:10 +0200
  [PATCH 03/15] liblockdep: Define the ARRAY_SIZE() macro alexander.levin@verizon.com - 2017-05-18 02:10 +0200
  [PATCH 14/15] tools: liblockdep: Remove double-quotes from soname alexander.levin@verizon.com - 2017-05-18 02:10 +0200
  [PATCH 04/15] liblockdep: Enable -Wall by default alexander.levin@verizon.com - 2017-05-18 02:20 +0200
  [PATCH 07/15] liblockdep: Fix 'defined but not used' warning for  init_utsname() alexander.levin@verizon.com - 2017-05-18 02:20 +0200
  [PATCH 13/15] tools: liblockdep: Fix object file paths used in an  out-of-tree build alexander.levin@verizon.com - 2017-05-18 02:20 +0200
  [PATCH 11/15] tools: liblockdep: Don't mix fd-based and stream IO alexander.levin@verizon.com - 2017-05-18 02:20 +0200
  [PATCH 06/15] liblockdep: Fix 'set but not used' warnings alexander.levin@verizon.com - 2017-05-18 02:20 +0200
  Re: [PATCH 01/15] liblockdep: Fix undefined symbol prandom_u32 Ingo Molnar <mingo@kernel.org> - 2017-05-24 10:00 +0200

csiph-web