usb: host: ohci: Mark cc_to_error as __maybe_unused
authorLee Jones <lee.jones@linaro.org>
Thu, 2 Jul 2020 14:46:16 +0000 (15:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Jul 2020 08:18:40 +0000 (10:18 +0200)
drivers/usb/host/ohci.h in included by a whole much of different
sourcefiles.  Not all of them make use of cc_to_error.  So mark
it as __maybe_used to convey that this behaviour is not only
acceptable it's expected.

Fixes the following kernel build warning(s):

 In file included from drivers/usb/host/ohci-pci.c:25:
 drivers/usb/host/ohci.h:165:18: warning: ‘cc_to_error’ defined but not used [-Wunused-const-variable=]
 165 | static const int cc_to_error 1 = {
 | ^~~~~~~~~~~
 In file included from drivers/usb/host/ohci-platform.c:32:
 drivers/usb/host/ohci.h:165:18: warning: ‘cc_to_error’ defined but not used [-Wunused-const-variable=]
 165 | static const int cc_to_error 1 = {
 | ^~~~~~~~~~~
 In file included from drivers/usb/host/ohci-exynos.c:20:
 drivers/usb/host/ohci.h:165:18: warning: ‘cc_to_error’ defined but not used [-Wunused-const-variable=]
 165 | static const int cc_to_error 1 = {
 | ^~~~~~~~~~~
 In file included from drivers/usb/host/ohci-spear.c:22:
 drivers/usb/host/ohci.h:165:18: warning: ‘cc_to_error’ defined but not used [-Wunused-const-variable=]
 165 | static const int cc_to_error 1 = {
 | ^~~~~~~~~~~
 In file included from drivers/usb/host/ohci-st.c:26:
 drivers/usb/host/ohci.h:165:18: warning: ‘cc_to_error’ defined but not used [-Wunused-const-variable=]
 165 | static const int cc_to_error 1 = {
 | ^~~~~~~~~~~
 In file included from drivers/usb/host/ohci-at91.c:31:
 drivers/usb/host/ohci.h:165:18: warning: ‘cc_to_error’ defined but not used [-Wunused-const-variable=]
 165 | static const int cc_to_error 1 = {
 | ^~~~~~~~~~~
 In file included from drivers/usb/host/ohci-s3c2410.c:32:
 drivers/usb/host/ohci.h:165:18: warning: ‘cc_to_error’ defined but not used [-Wunused-const-variable=]
 165 | static const int cc_to_error 1 = {
 | ^~~~~~~~~~~

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Roman Weissgaerber <weissg@vienna.at>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20200702144625.2533530-22-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci.h

index b85a395..aac6285 100644 (file)
@@ -162,7 +162,7 @@ struct td {
 
 
 /* map OHCI TD status codes (CC) to errno values */
-static const int cc_to_error [16] = {
+static const int __maybe_unused cc_to_error [16] = {
        /* No  Error  */               0,
        /* CRC Error  */               -EILSEQ,
        /* Bit Stuff  */               -EPROTO,