From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [85.220.165.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BAF56D13 for ; Thu, 15 Apr 2021 06:55:45 +0000 (UTC) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lWvub-000396-V3; Thu, 15 Apr 2021 08:55:37 +0200 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lWvuZ-0006W1-P5; Thu, 15 Apr 2021 08:55:35 +0200 Date: Thu, 15 Apr 2021 08:55:35 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Lee Jones Cc: linux-kernel@vger.kernel.org, Ian Abbott , H Hartley Sweeten , Greg Kroah-Hartman , Thierry Reding , "David A. Schleef" , Mori Hess , Truxton Fulton , linux-staging@lists.linux.dev, linux-pwm@vger.kernel.org Subject: Re: [PATCH 55/57] staging: comedi: drivers: ni_mio_common: Move 'range_ni_E_ao_ext' to where it is used Message-ID: <20210415065535.eff56u7nhfhrcnl3@pengutronix.de> References: <20210414181129.1628598-1-lee.jones@linaro.org> <20210414181129.1628598-56-lee.jones@linaro.org> X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="f4boi5bpfqf5gex7" Content-Disposition: inline In-Reply-To: <20210414181129.1628598-56-lee.jones@linaro.org> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-staging@lists.linux.dev --f4boi5bpfqf5gex7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Lee, nitpick: You move range_ni_E_ao_ext to the header. However that header doesn't use range_ni_E_ao_ext, so the subject is technically wrong. On Wed, Apr 14, 2021 at 07:11:27PM +0100, Lee Jones wrote: > ... and mark it as __maybe_unused since not all users of the > header file reference it. >=20 > Fixes the following W=3D1 kernel build warning(s): >=20 > drivers/staging/comedi/drivers/ni_mio_common.c:163:35: warning: =E2=80= =98range_ni_E_ao_ext=E2=80=99 defined but not used [-Wunused-const-variable= =3D] >=20 > Cc: Ian Abbott > Cc: H Hartley Sweeten > Cc: Greg Kroah-Hartman > Cc: Thierry Reding > Cc: "Uwe Kleine-K=C3=B6nig" > Cc: Lee Jones > Cc: "David A. Schleef" > Cc: Mori Hess > Cc: Truxton Fulton > Cc: linux-staging@lists.linux.dev > Cc: linux-pwm@vger.kernel.org > Signed-off-by: Lee Jones > --- > drivers/staging/comedi/drivers/ni_mio_common.c | 9 --------- > drivers/staging/comedi/drivers/ni_stc.h | 9 ++++++++- > 2 files changed, 8 insertions(+), 10 deletions(-) >=20 > diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/sta= ging/comedi/drivers/ni_mio_common.c > index 4f80a4991f953..37615b4e2c10d 100644 > --- a/drivers/staging/comedi/drivers/ni_mio_common.c > +++ b/drivers/staging/comedi/drivers/ni_mio_common.c > @@ -160,15 +160,6 @@ static const struct comedi_lrange range_ni_M_ai_628x= =3D { > } > }; > =20 > -static const struct comedi_lrange range_ni_E_ao_ext =3D { > - 4, { > - BIP_RANGE(10), > - UNI_RANGE(10), > - RANGE_ext(-1, 1), > - RANGE_ext(0, 1) > - } > -}; > - > static const struct comedi_lrange *const ni_range_lkup[] =3D { > [ai_gain_16] =3D &range_ni_E_ai, > [ai_gain_8] =3D &range_ni_E_ai_limited, > diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/co= medi/drivers/ni_stc.h > index fbc0b753a0f59..0822e65f709dd 100644 > --- a/drivers/staging/comedi/drivers/ni_stc.h > +++ b/drivers/staging/comedi/drivers/ni_stc.h > @@ -1137,6 +1137,13 @@ struct ni_private { > u8 rgout0_usage; > }; > =20 > -static const struct comedi_lrange range_ni_E_ao_ext; > +static const struct comedi_lrange __maybe_unused range_ni_E_ao_ext =3D { > + 4, { > + BIP_RANGE(10), > + UNI_RANGE(10), > + RANGE_ext(-1, 1), > + RANGE_ext(0, 1) > + } > +}; I think a downside of this solution is that range_ni_E_ao_ext might be duplicated in the object files. (Ditto for the status quo BTW.) I think the right approach to fix the compiler warning and the duplication is to declare range_ni_E_ao_ext external in the header and keep the definition in ni_mio_common.c. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=C3=B6nig = | Industrial Linux Solutions | https://www.pengutronix.de/ | --f4boi5bpfqf5gex7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmB342QACgkQwfwUeK3K 7AmX5gf/dIlnwiXhI52/OOiPEZTsrfSg1t8iPwITw1Kexfp+BiH0njLzCaDtiQSB GrD7qoOw2/YCKCrJTErs+OJ+8dRmXWV7ynsFAf9vvDuNsnF+Mef9++t92If64pIu DNf/VSorofSmfYgMrizczIi6qBufr3Of1s3ebBmrQbDiM8KHNwZTC60Fy6knnE95 3Pln3knZecUShJgGgilFyXLuPEl+lmgDD+X0tWNdRXkxY1HmeC07SlgRXYO+fPAk TzqO62RJG6dM/nawDHT1VjucYmUknbr6bta8rbDJauKtDn2Hshb04dIyaDJNXCuB cyhjtvS8nFxTR/rba97wd7Df8Wkmaw== =lG+K -----END PGP SIGNATURE----- --f4boi5bpfqf5gex7--