From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754767AbdERARy (ORCPT ); Wed, 17 May 2017 20:17:54 -0400 Received: from omzsmtpe02.verizonbusiness.com ([199.249.25.209]:31868 "EHLO omzsmtpe02.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754684AbdERARi (ORCPT ); Wed, 17 May 2017 20:17:38 -0400 X-IronPort-Anti-Spam-Filtered: false X-IronPort-AV: E=Sophos;i="5.38,356,1491264000"; d="scan'208";a="1447465739" From: alexander.levin@verizon.com X-Host: discovery.odc.vzwcorp.com To: "mingo@kernel.org" CC: "ben@decadent.org.uk" , "linux-kernel@vger.kernel.org" Subject: [PATCH 07/15] liblockdep: Fix 'defined but not used' warning for init_utsname() Thread-Topic: [PATCH 07/15] liblockdep: Fix 'defined but not used' warning for init_utsname() Thread-Index: AQHSz2nwqv2FnV+qXEOg8D5S5F60uQ== Date: Thu, 18 May 2017 00:01:45 +0000 Message-ID: <20170518000231.16163-7-alexander.levin@verizon.com> References: <20170518000231.16163-1-alexander.levin@verizon.com> In-Reply-To: <20170518000231.16163-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v4I0I6bn010193 From: Ben Hutchings 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 --- 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