2013-03-26 18:14:10

by Tony Prisk

[permalink] [raw]
Subject: [PATCHv2] usb: ehci: unlink_empty_async_suspended() only used with CONFIG_PM

Compiling with !CONFIG_PM generates an unused function warning on
unlink_empty_async_suspended().

Enclose the function in a #ifdef CONFIG_PM

Signed-off-by: Tony Prisk <[email protected]>
---
Fixed up the commit message.
drivers/usb/host/ehci-q.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 23d1369..3638b28 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1316,6 +1316,7 @@ static void unlink_empty_async(struct ehci_hcd *ehci)
}
}

+#ifdef CONFIG_PM
/* The root hub is suspended; unlink all the async QHs */
static void unlink_empty_async_suspended(struct ehci_hcd *ehci)
{
@@ -1328,7 +1329,7 @@ static void unlink_empty_async_suspended(struct ehci_hcd *ehci)
}
start_iaa_cycle(ehci, false);
}
-
+#endif
/* makes sure the async qh will become idle */
/* caller must own ehci->lock */

--
1.7.9.5


2013-03-26 18:45:30

by Alan Stern

[permalink] [raw]
Subject: Re: [PATCHv2] usb: ehci: unlink_empty_async_suspended() only used with CONFIG_PM

On Wed, 27 Mar 2013, Tony Prisk wrote:

> Compiling with !CONFIG_PM generates an unused function warning on
> unlink_empty_async_suspended().
>
> Enclose the function in a #ifdef CONFIG_PM
>
> Signed-off-by: Tony Prisk <[email protected]>
> ---
> Fixed up the commit message.
> drivers/usb/host/ehci-q.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
> index 23d1369..3638b28 100644
> --- a/drivers/usb/host/ehci-q.c
> +++ b/drivers/usb/host/ehci-q.c
> @@ -1316,6 +1316,7 @@ static void unlink_empty_async(struct ehci_hcd *ehci)
> }
> }
>
> +#ifdef CONFIG_PM
> /* The root hub is suspended; unlink all the async QHs */
> static void unlink_empty_async_suspended(struct ehci_hcd *ehci)
> {
> @@ -1328,7 +1329,7 @@ static void unlink_empty_async_suspended(struct ehci_hcd *ehci)
> }
> start_iaa_cycle(ehci, false);
> }
> -
> +#endif
> /* makes sure the async qh will become idle */
> /* caller must own ehci->lock */

Acked-by: Alan Stern <[email protected]>

... except that the blank line before the comment in the hunk above
should be retained, not removed.