From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751647AbdFEJJR (ORCPT ); Mon, 5 Jun 2017 05:09:17 -0400 Received: from terminus.zytor.com ([65.50.211.136]:56935 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbdFEJJP (ORCPT ); Mon, 5 Jun 2017 05:09:15 -0400 Date: Mon, 5 Jun 2017 02:04:38 -0700 From: tip-bot for Ben Hutchings Message-ID: Cc: tglx@linutronix.de, hpa@zytor.com, ben@decadent.org.uk, peterz@infradead.org, linux-kernel@vger.kernel.org, mingo@kernel.org, sasha.levin@oracle.com, torvalds@linux-foundation.org Reply-To: sasha.levin@oracle.com, mingo@kernel.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, ben@decadent.org.uk, peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com In-Reply-To: <20170525130005.5947-8-alexander.levin@verizon.com> References: <20170525130005.5947-8-alexander.levin@verizon.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] tools/lib/lockdep: Fix 'defined but not used' warning for init_utsname() Git-Commit-ID: 1baa75406ecc2d77c9e6ecf45a707838a5bf7f29 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 1baa75406ecc2d77c9e6ecf45a707838a5bf7f29 Gitweb: http://git.kernel.org/tip/1baa75406ecc2d77c9e6ecf45a707838a5bf7f29 Author: Ben Hutchings AuthorDate: Thu, 25 May 2017 12:58:39 +0000 Committer: Ingo Molnar CommitDate: Mon, 5 Jun 2017 09:28:06 +0200 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 Signed-off-by: Sasha Levin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: a.p.zijlstra@chello.nl Link: http://lkml.kernel.org/r/20170525130005.5947-8-alexander.levin@verizon.com Signed-off-by: Ingo Molnar --- 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 443acb1..209f967 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 d107903..c157242 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