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

From: Lee Jones
Date: Thu Jul 02 2020 - 10:48:29 EST


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@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
---
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