usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM
Subsystems (2)
PATCH 1/1 usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM
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.
--- drivers/usb/host/xhci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/host/xhci.c +3 -3
@@ -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) { }
Signature · 1 line
1.8.4.2
PATCH v2 1/1 usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM
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.
---
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(-)
drivers/usb/host/xhci.c +1 -1
@@ -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) { }
Signature · 1 line
1.8.4.2
Hi Sarah,
Quoted 10 lines · David Cohen
When
CONFIG_PCIandCONFIG_PMare not selected,xhci.cgets 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_unusedflag onxhci_msix_sync_irqs()function in case of !CONFIG_PCI.Signed-off-by David Cohen <[email protected]>---
Ping :)
Any comments here?
Br, David
Quoted 24 lines
Change v1 -> v2:
-xhci_msix_sync_irqs()already uses__maybe_unusedflag whenCONFIG_PCIis 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(-)drivers/usb/host/xhci.c +1
-1@@ -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) { }Signature · 1 line
1.8.4.2
Quoted 36 lines · David Cohen
Hi Sarah,
Quoted 10 lines · David Cohen
When
CONFIG_PCIandCONFIG_PMare not selected,xhci.cgets 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_unusedflag onxhci_msix_sync_irqs()function in case of !CONFIG_PCI.Signed-off-by David Cohen <[email protected]>---
Ping :)
Any comments here?Br, David
Quoted 17 lines
Change v1 -> v2:
-xhci_msix_sync_irqs()already uses__maybe_unusedflag whenCONFIG_PCIis 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(-)drivers/usb/host/xhci.c +0
-0@@ -406,7 +406,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci) { }
Quoted 2 lines
drivers/usb/host/xhci.c static void xhci_cleanup_msix(struct xhci_hcd *xhci) · line 409
Quoted 2 lines
drivers/usb/host/xhci.c +1
-1-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:
drivers/usb/host/xhci.c +3 -3
@@ -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) { }
Signature · 1 line
balbi
Quoted 37 lines · Felipe Balbi
Quoted 36 lines · David Cohen
Hi Sarah,
Quoted 10 lines · David Cohen
When
CONFIG_PCIandCONFIG_PMare not selected,xhci.cgets 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_unusedflag onxhci_msix_sync_irqs()function in case of !CONFIG_PCI.Signed-off-by David Cohen <[email protected]>---
Ping :)
Any comments here?Br, David
Quoted 17 lines
Change v1 -> v2:
-xhci_msix_sync_irqs()already uses__maybe_unusedflag whenCONFIG_PCIis 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(-)drivers/usb/host/xhci.c +0
-0@@ -406,7 +406,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci) { }
Quoted 5 lines
Quoted 2 lines
drivers/usb/host/xhci.c static void xhci_cleanup_msix(struct xhci_hcd *xhci) · line 409
Quoted 2 lines
drivers/usb/host/xhci.c +1
-1-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
Quoted 28 lines
drivers/usb/host/xhci.c +3
-3@@ -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) { }Signature · 2 lines
-- balbi
Hi Mathias,
Quoted 44 lines · David Cohen
Quoted 37 lines · Felipe Balbi
Quoted 36 lines · David Cohen
Hi Sarah,
Quoted 10 lines · David Cohen
When
CONFIG_PCIandCONFIG_PMare not selected,xhci.cgets 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_unusedflag onxhci_msix_sync_irqs()function in case of !CONFIG_PCI.Signed-off-by David Cohen <[email protected]>---
Ping :)
Any comments here?Br, David
Quoted 17 lines
Change v1 -> v2:
-xhci_msix_sync_irqs()already uses__maybe_unusedflag whenCONFIG_PCIis 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(-)drivers/usb/host/xhci.c +0
-0@@ -406,7 +406,7 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci) { }Quoted 5 lines
Quoted 2 lines
drivers/usb/host/xhci.c static void xhci_cleanup_msix(struct xhci_hcd *xhci) · line 409
Quoted 2 lines
drivers/usb/host/xhci.c +1
-1-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:
Quoted 4 lines
Thanks for commenting. That would be actually the v1 of my patch :) I changed after I see the proper function has
__maybe_unusedflag.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
Quoted 34 lines
Br, David
Quoted 28 lines
drivers/usb/host/xhci.c +3
-3@@ -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) { }Signature · 2 lines
-- balbi
Quoted 6 lines · David Cohen
Hi Mathias,
Quoted 4 lines
Thanks for commenting. That would be actually the v1 of my patch :) I changed after I see the proper function has
__maybe_unusedflag.
Quoted 7 lines
Quoted 1 line
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