All of lore.kernel.org
 help / color / mirror / Atom feed
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/6] usb: ohci-at91: use __maybe_unused to hide pm functions
Date: Wed, 2 Mar 2016 16:34:12 +0100	[thread overview]
Message-ID: <56D707F4.9030903@atmel.com> (raw)
In-Reply-To: <1456932255-71725-4-git-send-email-arnd@arndb.de>

Le 02/03/2016 16:24, Arnd Bergmann a ?crit :
> The ohci-at91 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/ohci-at91.c:587:1: error: 'ohci_hcd_at91_drv_suspend' defined but not used [-Werror=unused-function]
> drivers/usb/host/ohci-at91.c:631:12: error: 'ohci_hcd_at91_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 <arnd@arndb.de>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thanks Arnd, bye.

> ---
>  drivers/usb/host/ohci-at91.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
> index 95c8ddde0725..d177372bb357 100644
> --- a/drivers/usb/host/ohci-at91.c
> +++ b/drivers/usb/host/ohci-at91.c
> @@ -581,9 +581,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM
> -
> -static int
> +static int __maybe_unused
>  ohci_hcd_at91_drv_suspend(struct device *dev)
>  {
>  	struct usb_hcd	*hcd = dev_get_drvdata(dev);
> @@ -628,7 +626,8 @@ ohci_hcd_at91_drv_suspend(struct device *dev)
>  	return ret;
>  }
>  
> -static int ohci_hcd_at91_drv_resume(struct device *dev)
> +static int __maybe_unused
> +ohci_hcd_at91_drv_resume(struct device *dev)
>  {
>  	struct usb_hcd	*hcd = dev_get_drvdata(dev);
>  	struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd);
> @@ -641,7 +640,6 @@ static int ohci_hcd_at91_drv_resume(struct device *dev)
>  	ohci_resume(hcd, false);
>  	return 0;
>  }
> -#endif
>  
>  static SIMPLE_DEV_PM_OPS(ohci_hcd_at91_pm_ops, ohci_hcd_at91_drv_suspend,
>  					ohci_hcd_at91_drv_resume);
> 


-- 
Nicolas Ferre

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Felipe Balbi <balbi@kernel.org>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/6] usb: ohci-at91: use __maybe_unused to hide pm functions
Date: Wed, 2 Mar 2016 16:34:12 +0100	[thread overview]
Message-ID: <56D707F4.9030903@atmel.com> (raw)
In-Reply-To: <1456932255-71725-4-git-send-email-arnd@arndb.de>

Le 02/03/2016 16:24, Arnd Bergmann a écrit :
> The ohci-at91 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/ohci-at91.c:587:1: error: 'ohci_hcd_at91_drv_suspend' defined but not used [-Werror=unused-function]
> drivers/usb/host/ohci-at91.c:631:12: error: 'ohci_hcd_at91_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 <arnd@arndb.de>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thanks Arnd, bye.

> ---
>  drivers/usb/host/ohci-at91.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
> index 95c8ddde0725..d177372bb357 100644
> --- a/drivers/usb/host/ohci-at91.c
> +++ b/drivers/usb/host/ohci-at91.c
> @@ -581,9 +581,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM
> -
> -static int
> +static int __maybe_unused
>  ohci_hcd_at91_drv_suspend(struct device *dev)
>  {
>  	struct usb_hcd	*hcd = dev_get_drvdata(dev);
> @@ -628,7 +626,8 @@ ohci_hcd_at91_drv_suspend(struct device *dev)
>  	return ret;
>  }
>  
> -static int ohci_hcd_at91_drv_resume(struct device *dev)
> +static int __maybe_unused
> +ohci_hcd_at91_drv_resume(struct device *dev)
>  {
>  	struct usb_hcd	*hcd = dev_get_drvdata(dev);
>  	struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd);
> @@ -641,7 +640,6 @@ static int ohci_hcd_at91_drv_resume(struct device *dev)
>  	ohci_resume(hcd, false);
>  	return 0;
>  }
> -#endif
>  
>  static SIMPLE_DEV_PM_OPS(ohci_hcd_at91_pm_ops, ohci_hcd_at91_drv_suspend,
>  					ohci_hcd_at91_drv_resume);
> 


-- 
Nicolas Ferre

  reply	other threads:[~2016-03-02 15:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 15:24 usb: avoid warnings for unused pm functions Arnd Bergmann
2016-03-02 15:24 ` [PATCH 1/6] usb: host: unhide suspend/resume declarations Arnd Bergmann
2016-03-02 15:24   ` Arnd Bergmann
2016-03-02 15:58   ` Alan Stern
2016-03-02 15:58     ` Alan Stern
2016-03-02 15:24 ` [PATCH 2/6] usb: xhci-mtk: use __maybe_unused to hide pm functions Arnd Bergmann
2016-03-02 15:24   ` Arnd Bergmann
     [not found]   ` <1456932255-71725-3-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2016-03-04 16:33     ` Matthias Brugger
2016-03-04 16:33       ` Matthias Brugger
2016-03-04 16:33       ` Matthias Brugger
     [not found]       ` <56D9B8EE.3060107-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-10 11:42         ` Mathias Nyman
2016-03-10 11:42           ` Mathias Nyman
2016-03-10 11:42           ` Mathias Nyman
2016-03-02 15:24 ` [PATCH 3/6] usb: ohci-at91: " Arnd Bergmann
2016-03-02 15:24   ` Arnd Bergmann
2016-03-02 15:34   ` Nicolas Ferre [this message]
2016-03-02 15:34     ` Nicolas Ferre
2016-03-02 15:24 ` [PATCH 4/6] usb: ehci-atmel: " Arnd Bergmann
2016-03-02 15:24   ` Arnd Bergmann
2016-03-02 15:34   ` Nicolas Ferre
2016-03-02 15:34     ` Nicolas Ferre
2016-03-02 15:24 ` [PATCH 5/6] phy: dm816x: " Arnd Bergmann
2016-03-02 15:24   ` Arnd Bergmann
2016-03-02 15:24 ` [PATCH 6/6] phy: twl4030: " Arnd Bergmann
2016-03-02 15:24   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D707F4.9030903@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.