* [PATCH] usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM @ 2014-01-07 1:44 David Cohen 2014-01-07 3:02 ` [PATCH v2] " David Cohen 0 siblings, 1 reply; 7+ messages in thread From: David Cohen @ 2014-01-07 1:44 UTC (permalink / raw) To: sarah.a.sharp, gregkh; +Cc: linux-usb, linux-kernel, David Cohen 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] Instead of creating nested #ifdefs, this patch fixes it by defining the xHCI PCI stubs as inline. Signed-off-by: David Cohen <david.a.cohen@linux.intel.com> --- drivers/usb/host/xhci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 4265b48856f6..672df9840014 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -397,16 +397,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) { } -- 1.8.4.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2] usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM 2014-01-07 1:44 [PATCH] usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM David Cohen @ 2014-01-07 3:02 ` David Cohen 2014-02-18 18:00 ` David Cohen 0 siblings, 1 reply; 7+ messages in thread From: David Cohen @ 2014-01-07 3:02 UTC (permalink / raw) To: sarah.a.sharp, gregkh; +Cc: linux-usb, linux-kernel, David Cohen 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@linux.intel.com> --- 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) { } -- 1.8.4.2 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM 2014-01-07 3:02 ` [PATCH v2] " David Cohen @ 2014-02-18 18:00 ` David Cohen 2014-02-18 18:47 ` Felipe Balbi 0 siblings, 1 reply; 7+ messages in thread From: David Cohen @ 2014-02-18 18:00 UTC (permalink / raw) To: sarah.a.sharp, gregkh; +Cc: linux-usb, linux-kernel 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@linux.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) > { > } > > -- > 1.8.4.2 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM 2014-02-18 18:00 ` David Cohen @ 2014-02-18 18:47 ` Felipe Balbi 2014-02-18 19:04 ` David Cohen 0 siblings, 1 reply; 7+ messages in thread From: Felipe Balbi @ 2014-02-18 18:47 UTC (permalink / raw) To: David Cohen; +Cc: sarah.a.sharp, gregkh, linux-usb, linux-kernel [-- Attachment #1: Type: text/plain, Size: 2116 bytes --] 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@linux.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 [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM 2014-02-18 18:47 ` Felipe Balbi @ 2014-02-18 19:04 ` David Cohen 2014-03-21 21:41 ` David Cohen 0 siblings, 1 reply; 7+ messages in thread From: David Cohen @ 2014-02-18 19:04 UTC (permalink / raw) To: Felipe Balbi; +Cc: sarah.a.sharp, gregkh, linux-usb, linux-kernel On Tue, Feb 18, 2014 at 12:47:41PM -0600, Felipe Balbi wrote: > 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@linux.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: Thanks for commenting. That would be actually the v1 of my patch :) I changed after I see the proper function has __maybe_unused flag. But I'm fine with Sarah picking any of the patch's versions. Br, David > > 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM 2014-02-18 19:04 ` David Cohen @ 2014-03-21 21:41 ` David Cohen 2014-03-24 11:44 ` Mathias Nyman 0 siblings, 1 reply; 7+ messages in thread From: David Cohen @ 2014-03-21 21:41 UTC (permalink / raw) To: Felipe Balbi, mathias.nyman; +Cc: gregkh, linux-usb, linux-kernel Hi Mathias, On Tue, Feb 18, 2014 at 11:04:12AM -0800, David Cohen wrote: > On Tue, Feb 18, 2014 at 12:47:41PM -0600, Felipe Balbi wrote: > > 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@linux.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: > > Thanks for commenting. That would be actually the v1 of my patch :) > I changed after I see the proper function has __maybe_unused flag. > > But I'm fine with Sarah picking any of the patch's versions. Guess you're handling the review of this trivial patch now :) Comments are very welcome. Br, David > > Br, David > > > > > 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 > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM 2014-03-21 21:41 ` David Cohen @ 2014-03-24 11:44 ` Mathias Nyman 0 siblings, 0 replies; 7+ messages in thread From: Mathias Nyman @ 2014-03-24 11:44 UTC (permalink / raw) To: David Cohen; +Cc: Felipe Balbi, gregkh, linux-usb, linux-kernel On 03/21/2014 11:41 PM, David Cohen wrote: > Hi Mathias, > >> >> Thanks for commenting. That would be actually the v1 of my patch :) >> I changed after I see the proper function has __maybe_unused flag. >> >> But I'm fine with Sarah picking any of the patch's versions. > > Guess you're handling the review of this trivial patch now :) > Comments are very welcome. > > Br, David > Hi Patch version 1 inlining the stubs looks good to me. I'll queue it for Greg’s usb-linus once 3.15-rc1 is out. -Mathias ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-03-24 11:34 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-01-07 1:44 [PATCH] usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM David Cohen 2014-01-07 3:02 ` [PATCH v2] " David Cohen 2014-02-18 18:00 ` David Cohen 2014-02-18 18:47 ` Felipe Balbi 2014-02-18 19:04 ` David Cohen 2014-03-21 21:41 ` David Cohen 2014-03-24 11:44 ` Mathias Nyman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox