From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932453AbcFNUtN (ORCPT ); Tue, 14 Jun 2016 16:49:13 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:52732 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752932AbcFNUtL (ORCPT ); Tue, 14 Jun 2016 16:49:11 -0400 Date: Tue, 14 Jun 2016 21:49:09 +0100 From: Ben Hutchings To: Sasha Levin Cc: linux-kernel@vger.kernel.org Message-ID: <20160614204909.GZ7555@decadent.org.uk> References: <20160614204437.GS7555@decadent.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8JAmzYDSl0Sjbh5d" Content-Disposition: inline In-Reply-To: <20160614204437.GS7555@decadent.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: ben@decadent.org.uk Subject: [PATCH 7/7] liblockdep: Fix 'defined but not used' warning for init_utsname() X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on shadbolt.decadent.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --8JAmzYDSl0Sjbh5d Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 --- 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 =20 +static struct new_utsname *init_utsname(void) +{ + static struct new_utsname n =3D (struct new_utsname) { + .release =3D "liblockdep", + .version =3D 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))++) =20 -static struct new_utsname *init_utsname(void) -{ - static struct new_utsname n =3D (struct new_utsname) { - .release =3D "liblockdep", - .version =3D LIBLOCKDEP_VERSION, - }; - - return &n; -} - #define print_tainted() "" #define static_obj(x) 1 =20 --8JAmzYDSl0Sjbh5d Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIVAwUBV2Btxee/yOyVhhEJAQqlHA/9GX8rG1Ju6vvJ2zRNdALiqRcyOQK0Sd3i N3zWPd0xR7gdPlYMGCfjVvsGI0gUEccx+Vc31oOOmZGo6/WAxhQonTXM45VQNLL4 ssYKxPrty25L7pDAYT4g4i5ISplulzAbcFJf0LBR5Xobh30x2ZGRixzoPnWka2Bt h98+6lhy840k472biZZvb4vBmzK34JeERMAN7ruYdCVk5lYARfybURynWHdzCn06 I9mFzOBAjxwUuzSZIQlYrf7ur+7SVDaBNZSQAOdvyth05kGY6tZMn0+LCr6rPszQ wvr82VOEP2QQKINCpq9/vxfExs85XiE4YHezXXx2ZVbPEDdZFokWOyhcv/FQFLpD x7G+fpiNSKYh+bco9XnGijApHZUpMycBbu5sbvqL+1bHUKKa5Z0CVrhKIvZ0DNMy ob+QGNfHWQBxDbfLC7TBJe/YgYYMlaXUsor/Ug7SB7l/B7zS287fgdWt942VY1hk bxa5UUoXBgsL8RodHhwlFZx+gPkzDKPINrT3geXkmqlyyn3rLlaZwYyhVhFQ1pKG rj/zwVY93KwumcfZRtuKJP+ZBl+UuGN+55r3B7K+Vofw5h8tt+WDhTJme9GDSZPE xpJ04N5VHxFN1u2BUbkbjcEpvV59sYF9rsriwcW21Qy0wRDT/v+w4MCVPycBg/tT vuLUK5XHivE= =DCIO -----END PGP SIGNATURE----- --8JAmzYDSl0Sjbh5d--