From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755524AbcCBPgZ (ORCPT ); Wed, 2 Mar 2016 10:36:25 -0500 Received: from eusmtp01.atmel.com ([212.144.249.243]:49805 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754857AbcCBPeW (ORCPT ); Wed, 2 Mar 2016 10:34:22 -0500 Subject: Re: [PATCH 4/6] usb: ehci-atmel: use __maybe_unused to hide pm functions To: Arnd Bergmann , Greg Kroah-Hartman References: <1456932255-71725-1-git-send-email-arnd@arndb.de> <1456932255-71725-5-git-send-email-arnd@arndb.de> CC: Felipe Balbi , , , Alan Stern , From: Nicolas Ferre Organization: atmel Message-ID: <56D70805.805@atmel.com> Date: Wed, 2 Mar 2016 16:34:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1456932255-71725-5-git-send-email-arnd@arndb.de> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.161.30.18] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 02/03/2016 16:24, Arnd Bergmann a écrit : > The ehci-atmel driver uses #ifdef to check for CONFIG_PM, but then > uses SIMPLE_DEV_PM_OPS, which leaves the references out when > CONFIG_PM_SLEEP is not defined, so we get a warning with > PM=y && PM_SLEEP=n: > > drivers/usb/host/ehci-atmel.c:189:12: error: 'ehci_atmel_drv_suspend' defined but not used [-Werror=unused-function] > drivers/usb/host/ehci-atmel.c:203:12: error: 'ehci_atmel_drv_resume' defined but not used [-Werror=unused-function] > > This removes the incorrect #ifdef and instead uses a __maybe_unused > annotation to let the compiler know it can silently drop > the function definition. > > Signed-off-by: Arnd Bergmann Acked-by: Nicolas Ferre > --- > drivers/usb/host/ehci-atmel.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c > index be0964a801e8..7440722bfbf0 100644 > --- a/drivers/usb/host/ehci-atmel.c > +++ b/drivers/usb/host/ehci-atmel.c > @@ -185,8 +185,7 @@ static int ehci_atmel_drv_remove(struct platform_device *pdev) > return 0; > } > > -#ifdef CONFIG_PM > -static int ehci_atmel_drv_suspend(struct device *dev) > +static int __maybe_unused ehci_atmel_drv_suspend(struct device *dev) > { > struct usb_hcd *hcd = dev_get_drvdata(dev); > struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd); > @@ -200,7 +199,7 @@ static int ehci_atmel_drv_suspend(struct device *dev) > return 0; > } > > -static int ehci_atmel_drv_resume(struct device *dev) > +static int __maybe_unused ehci_atmel_drv_resume(struct device *dev) > { > struct usb_hcd *hcd = dev_get_drvdata(dev); > struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd); > @@ -208,7 +207,6 @@ static int ehci_atmel_drv_resume(struct device *dev) > atmel_start_clock(atmel_ehci); > return ehci_resume(hcd, false); > } > -#endif > > #ifdef CONFIG_OF > static const struct of_device_id atmel_ehci_dt_ids[] = { > -- Nicolas Ferre