From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935692AbcIGKjv (ORCPT ); Wed, 7 Sep 2016 06:39:51 -0400 Received: from mga11.intel.com ([192.55.52.93]:49166 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965142AbcIGKju (ORCPT ); Wed, 7 Sep 2016 06:39:50 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,296,1470726000"; d="asc'?scan'208";a="5418286" From: Felipe Balbi To: Arnd Bergmann , Greg Kroah-Hartman Cc: Arnd Bergmann , Heikki Krogerus , John Youn , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH for v4.8] usb: dwc3: mark PM function as __maybe_unused In-Reply-To: <20160906132318.2033811-1-arnd@arndb.de> References: <20160906132318.2033811-1-arnd@arndb.de> User-Agent: Notmuch/0.22.1+63~g994277e (https://notmuchmail.org) Emacs/25.1.3 (x86_64-pc-linux-gnu) Date: Wed, 07 Sep 2016 13:39:16 +0300 Message-ID: <87a8fkkn8r.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Arnd Bergmann writes: > Starting with v4.8-rc5, we get a warning about the dwc3_pci_pm_dummy func= tion > when CONFIG_PM_SLEEP is disabled: > > drivers/usb/dwc3/dwc3-pci.c:253:12: warning: 'dwc3_pci_pm_dummy' defined = but not used > > Using __maybe_unused instead of #ifdef lets the compiler figure out > whether it should drop the definitions silently and avoids this warning. > > Signed-off-by: Arnd Bergmann > Fixes: f6c274e11e3b ("usb: dwc3: pci: runtime_resume child device") > --- > drivers/usb/dwc3/dwc3-pci.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > After we fixed all other warnings reported by kernelci.org, this is > now the only thing we get a warning for in the configurations we build, > so it would be good to get this fixed before v4.8 to get a clean > build for the first time in a release. > > diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c > index 0a32430f4c41..6a82b36f0d59 100644 > --- a/drivers/usb/dwc3/dwc3-pci.c > +++ b/drivers/usb/dwc3/dwc3-pci.c > @@ -234,8 +234,7 @@ static const struct pci_device_id dwc3_pci_id_table[]= =3D { > }; > MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table); >=20=20 > -#ifdef CONFIG_PM > -static int dwc3_pci_runtime_suspend(struct device *dev) > +static int __maybe_unused dwc3_pci_runtime_suspend(struct device *dev) > { > if (device_run_wake(dev)) > return 0; > @@ -243,14 +242,14 @@ static int dwc3_pci_runtime_suspend(struct device *= dev) > return -EBUSY; > } >=20=20 > -static int dwc3_pci_runtime_resume(struct device *dev) > +static int __maybe_unused dwc3_pci_runtime_resume(struct device *dev) > { > struct platform_device *dwc3 =3D dev_get_drvdata(dev); >=20=20 > return pm_runtime_get(&dwc3->dev); > } >=20=20 > -static int dwc3_pci_pm_dummy(struct device *dev) > +static int __maybe_unused dwc3_pci_pm_dummy(struct device *dev) > { > /* > * There's nothing to do here. No, seriously. Everything is either taken > @@ -262,7 +261,6 @@ static int dwc3_pci_pm_dummy(struct device *dev) > */ > return 0; > } > -#endif /* CONFIG_PM */ seems like it would've been enough to define dwc3_pci_pm_dummy() if CONFIG_PM_SLEEP. Right? IOW: diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 0a32430f4c41..6df0f5dad9a4 100644 =2D-- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -249,7 +249,9 @@ static int dwc3_pci_runtime_resume(struct device *dev) =20 return pm_runtime_get(&dwc3->dev); } +#endif /* CONFIG_PM */ =20 +#ifdef CONFIG_PM_SLEEP static int dwc3_pci_pm_dummy(struct device *dev) { /* @@ -262,7 +264,7 @@ static int dwc3_pci_pm_dummy(struct device *dev) */ return 0; } =2D#endif /* CONFIG_PM */ +#endif /* CONFIG_PM_SLEEP */ =20 static struct dev_pm_ops dwc3_pci_dev_pm_ops =3D { SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_pm_dummy, dwc3_pci_pm_dummy) Can you check if this is enough for you? Works just fine here. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJXz+5UAAoJEMy+uJnhGpkGVv0P/15PZQLvDBkbFj+yWx2XWfg+ dcNVPRkTZz1OTkRXo0BeAHEKriXbLyXH1yTlQgDE8kud1WQFz1DFN0aQ7DASV4Pr LwjGf7K1fQZKMsRNxQOKx8TiOxzxob1GSM/qieupvwuhReze3AE5aOfP84AMi+80 S+aRreVORnirGOfu1RbNhSEJt0kw9AK24cBQTrHPMliTUPaIzakp3Hx10r6N1Emc 4eMUq04I9qMoUSk1I1fYVdms+fjx+xTZU1Nq6OOq1LDGMjYoe23njAvFrlc7TfuB KI+nDVGr4KOi/Soqg280BI1P3nZcjPFY13oPBSiv7PEUxfpWFthmEhlg1HSkN649 Xw2IO3QyVqk9CGk6HanT5ggrYOKDvj/C+gtLrO+CgbWzGx/O1yk0a5Q9wDQBSIb8 0C9mBR8l8p/Xl0vYb97sWwJUERvgif6pdGETgbrAZMLg7pOOlGafZMyNHS2ZjU67 AXwCY+dmNhue/1S6GtEdrX446yU4uv5VROJiZ6hI4Pb4bK0cGTTm4s10yyz0JAXs CVOBRotu+ol+cdAzCQSOJwsOObPV1guHzxMFuEcLSvVN+NStlu+PVyQUli5+eNRc Fb0hSgv0zomIL0owALGRxrMA9tFhYJOFIbT546/ozc9RGZSMGcuvwsMSx991dyPC u8ka7aANveAaliITp/fz =xLBT -----END PGP SIGNATURE----- --=-=-=--