From: Lee Jones Date: Thu, 2 Jul 2020 14:46:14 +0000 (+0100) Subject: usb: host: isp1362: Mark the many unused ISP1362_REG entries as __maybe_unused X-Git-Tag: v5.10.7~1952^2~184 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=048715c070bc3226bbf56c37d1a8ec4aee215ff7;p=platform%2Fkernel%2Flinux-rpi.git usb: host: isp1362: Mark the many unused ISP1362_REG entries as __maybe_unused 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" Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20200702144625.2533530-20-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/isp1362.h b/drivers/usb/host/isp1362.h index 4c49688..9bbfcc3 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)