[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140218184741.GI28506@saruman.home>
Date: Tue, 18 Feb 2014 12:47:41 -0600
From: Felipe Balbi <balbi@...com>
To: David Cohen <david.a.cohen@...ux.intel.com>
CC: <sarah.a.sharp@...ux.intel.com>, <gregkh@...uxfoundation.org>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] usb/xhci: fix compilation warning when !CONFIG_PCI &&
!CONFIG_PM
On Tue, Feb 18, 2014 at 10:00:30AM -0800, David Cohen wrote:
> Hi Sarah,
>
> On Mon, Jan 06, 2014 at 07:02:19PM -0800, David Cohen wrote:
> > When CONFIG_PCI and CONFIG_PM are not selected, xhci.c gets this
> > warning:
> > drivers/usb/host/xhci.c:409:13: warning: ‘xhci_msix_sync_irqs’ defined
> > but not used [-Wunused-function]
> >
> > It happens due to lack of __maybe_unused flag on xhci_msix_sync_irqs()
> > function in case of !CONFIG_PCI.
> >
> > Signed-off-by: David Cohen <david.a.cohen@...ux.intel.com>
> > ---
>
> Ping :)
> Any comments here?
>
> Br, David
>
> >
> > Change v1 -> v2:
> > - xhci_msix_sync_irqs() already uses __maybe_unused flag when CONFIG_PCI is
> > set. Proper solution is to add same flag when !CONFIG_PCI instead of define
> > function as inline.
> >
> > drivers/usb/host/xhci.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> > index 4265b48856f6..ed6b717b8ee1 100644
> > --- a/drivers/usb/host/xhci.c
> > +++ b/drivers/usb/host/xhci.c
> > @@ -406,7 +406,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci)
> > {
> > }
> >
> > -static void xhci_msix_sync_irqs(struct xhci_hcd *xhci)
> > +static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci)
bellow is likely a better fix. Usually stubs are marked inline, rather
than getting an unused attribute:
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 3712359..8f1a6d5 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -404,16 +404,16 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
#else
-static int xhci_try_enable_msi(struct usb_hcd *hcd)
+static inline int xhci_try_enable_msi(struct usb_hcd *hcd)
{
return 0;
}
-static void xhci_cleanup_msix(struct xhci_hcd *xhci)
+static inline void xhci_cleanup_msix(struct xhci_hcd *xhci)
{
}
-static void xhci_msix_sync_irqs(struct xhci_hcd *xhci)
+static inline void xhci_msix_sync_irqs(struct xhci_hcd *xhci)
{
}
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists