[PATCH 19/30] usb: host: isp1362: Mark the many unused ISP1362_REG entries as __maybe_unused

Lee Jones lee.jones at linaro.org
Thu Jul 2 10:46:14 EDT 2020


It would seem a shame to strip out all of the unused register entries,
since they can act as a fair source of documentation.  Instead, mark
them all as __maybe_unused to show the build system that this behaviour
is known and intentional.

Fixes the following kernel build warning(s):

 In file included from drivers/usb/host/isp1362-hcd.c:96:
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_OTGALTTMR’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:199:1: note: in expansion of macro ‘ISP1362_REG’
 199 | ISP1362_REG(OTGALTTMR, 0x6C, REG_WIDTH_16, REG_ACCESS_RW);
 | ^~~~~~~~~~~
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_OTGTIMER’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:198:1: note: in expansion of macro ‘ISP1362_REG’
 198 | ISP1362_REG(OTGTIMER, 0x6A, REG_WIDTH_16, REG_ACCESS_RW);
 | ^~~~~~~~~~~
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_OTGINTENB’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:197:1: note: in expansion of macro ‘ISP1362_REG’
 197 | ISP1362_REG(OTGINTENB, 0x69, REG_WIDTH_16, REG_ACCESS_RW);
 | ^~~~~~~~~~~
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_OTGINT’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:196:1: note: in expansion of macro ‘ISP1362_REG’
 196 | ISP1362_REG(OTGINT, 0x68, REG_WIDTH_16, REG_ACCESS_RW);
 | ^~~~~~~~~~~
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_OTGSTATUS’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:195:1: note: in expansion of macro ‘ISP1362_REG’
 195 | ISP1362_REG(OTGSTATUS, 0x67, REG_WIDTH_16, REG_ACCESS_R);
 | ^~~~~~~~~~~
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_OTGCONTROL’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:194:1: note: in expansion of macro ‘ISP1362_REG’
 194 | ISP1362_REG(OTGCONTROL, 0x62, REG_WIDTH_16, REG_ACCESS_RW);
 | ^~~~~~~~~~~
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_HCATLPORT’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:183:1: note: in expansion of macro ‘ISP1362_REG’
 183 | ISP1362_REG(HCATLPORT, 0x44, REG_WIDTH_16, REG_ACCESS_RW);
 | ^~~~~~~~~~~
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_HCINTLPORT’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:175:1: note: in expansion of macro ‘ISP1362_REG’
 175 | ISP1362_REG(HCINTLPORT, 0x43, REG_WIDTH_16, REG_ACCESS_RW);
 | ^~~~~~~~~~~
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_HCISTL1PORT’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:171:1: note: in expansion of macro ‘ISP1362_REG’
 171 | ISP1362_REG(HCISTL1PORT, 0x42, REG_WIDTH_16, REG_ACCESS_RW);
 | ^~~~~~~~~~~
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_HCISTL0PORT’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:170:1: note: in expansion of macro ‘ISP1362_REG’
 170 | ISP1362_REG(HCISTL0PORT, 0x40, REG_WIDTH_16, REG_ACCESS_RW);
 | ^~~~~~~~~~~
 drivers/usb/host/isp1362.h:59:22: warning: ‘ISP1362_REG_HCINTDIS’ defined but not used [-Wunused-const-variable=]
 59 | static isp1362_reg_t ISP1362_REG_##name = addr
 | ^~~~~~~~~~~~
 drivers/usb/host/isp1362.h:77:1: note: in expansion of macro ‘ISP1362_REG’
 77 | ISP1362_REG(HCINTDIS, 0x05, REG_WIDTH_32, REG_ACCESS_RW);
 | ^~~~~~~~~~~

Cc: "by L. Wassmann" <LW at KARO-electronics.de>
Signed-off-by: Lee Jones <lee.jones at linaro.org>
---
 drivers/usb/host/isp1362.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/isp1362.h b/drivers/usb/host/isp1362.h
index 4c49688a069d1..9bbfcc3fdd3cc 100644
--- a/drivers/usb/host/isp1362.h
+++ b/drivers/usb/host/isp1362.h
@@ -56,7 +56,7 @@ typedef const unsigned char isp1362_reg_t;
 #define ISP1362_REG_NO(r)		(r)
 
 #define ISP1362_REG(name, addr, width, rw) \
-static isp1362_reg_t ISP1362_REG_##name = addr
+static isp1362_reg_t __maybe_unused ISP1362_REG_##name = addr
 
 #define REG_ACCESS_TEST(r)		do {} while (0)
 #define REG_WIDTH_TEST(r, w)		do {} while (0)
-- 
2.25.1




More information about the linux-arm-kernel mailing list