mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: xhci: Mark two functions __maybe_unused
@ 2013-07-23 18:58 Olof Johansson
  2013-07-24 18:26 ` Sarah Sharp
  0 siblings, 1 reply; 2+ messages in thread
From: Olof Johansson @ 2013-07-23 18:58 UTC (permalink / raw)
  To: Sarah Sharp; +Cc: linux-usb, linux-kernel, Olof Johansson

Resolves the following build warnings:
drivers/usb/host/xhci.c:332:13: warning: 'xhci_msix_sync_irqs' defined but not used [-Wunused-function]
drivers/usb/host/xhci.c:3901:12: warning: 'xhci_change_max_exit_latency' defined but not used [-Wunused-function]

These functions are not always used, and since they're marked static
they will produce build warnings:
- xhci_msix_sync_irqs is only used with CONFIG_PCI.
- xhci_change_max_exit_latency is a little more complicated with
  dependencies on CONFIG_PM and CONFIG_PM_RUNTIME.

Instead of building a bigger maze of ifdefs in this code, I've just
marked both with __maybe_unused.

Signed-off-by: Olof Johansson <olof@lixom.net>
---

Sarah,

I guess taste might differ on ifdef vs __maybe_unused, let me know this
is not to your liking.

Thanks,

-Olof

 drivers/usb/host/xhci.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 2c49f00..87ae8cd 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -329,7 +329,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci)
 	return;
 }
 
-static void xhci_msix_sync_irqs(struct xhci_hcd *xhci)
+static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci)
 {
 	int i;
 
@@ -3898,7 +3898,7 @@ int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1)
  * Issue an Evaluate Context command to change the Maximum Exit Latency in the
  * slot context.  If that succeeds, store the new MEL in the xhci_virt_device.
  */
-static int xhci_change_max_exit_latency(struct xhci_hcd *xhci,
+static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci,
 			struct usb_device *udev, u16 max_exit_latency)
 {
 	struct xhci_virt_device *virt_dev;
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: xhci: Mark two functions __maybe_unused
  2013-07-23 18:58 [PATCH] usb: xhci: Mark two functions __maybe_unused Olof Johansson
@ 2013-07-24 18:26 ` Sarah Sharp
  0 siblings, 0 replies; 2+ messages in thread
From: Sarah Sharp @ 2013-07-24 18:26 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linux-usb, linux-kernel

On Tue, Jul 23, 2013 at 11:58:20AM -0700, Olof Johansson wrote:
> Resolves the following build warnings:
> drivers/usb/host/xhci.c:332:13: warning: 'xhci_msix_sync_irqs' defined but not used [-Wunused-function]
> drivers/usb/host/xhci.c:3901:12: warning: 'xhci_change_max_exit_latency' defined but not used [-Wunused-function]
> 
> These functions are not always used, and since they're marked static
> they will produce build warnings:
> - xhci_msix_sync_irqs is only used with CONFIG_PCI.
> - xhci_change_max_exit_latency is a little more complicated with
>   dependencies on CONFIG_PM and CONFIG_PM_RUNTIME.
> 
> Instead of building a bigger maze of ifdefs in this code, I've just
> marked both with __maybe_unused.
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
> 
> Sarah,
> 
> I guess taste might differ on ifdef vs __maybe_unused, let me know this
> is not to your liking.

__maybe_unused is fine, I will queue this up shortly.

Sarah Sharp

> 
> Thanks,
> 
> -Olof
> 
>  drivers/usb/host/xhci.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 2c49f00..87ae8cd 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -329,7 +329,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci)
>  	return;
>  }
>  
> -static void xhci_msix_sync_irqs(struct xhci_hcd *xhci)
> +static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci)
>  {
>  	int i;
>  
> @@ -3898,7 +3898,7 @@ int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1)
>   * Issue an Evaluate Context command to change the Maximum Exit Latency in the
>   * slot context.  If that succeeds, store the new MEL in the xhci_virt_device.
>   */
> -static int xhci_change_max_exit_latency(struct xhci_hcd *xhci,
> +static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci,
>  			struct usb_device *udev, u16 max_exit_latency)
>  {
>  	struct xhci_virt_device *virt_dev;
> -- 
> 1.7.10.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-24 18:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-23 18:58 [PATCH] usb: xhci: Mark two functions __maybe_unused Olof Johansson
2013-07-24 18:26 ` Sarah Sharp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®