pinctrl: realtek: Tag unused pins as __maybe_unused
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 6 Oct 2023 21:04:18 +0000 (23:04 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 6 Oct 2023 21:11:32 +0000 (23:11 +0200)
These pin definitions are helpful to have when working with the
driver in the future, so they are in a sense a bit like
documentation. They could be commented out as well, but why.

This should fix these build warnings:

drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning:
'rtd1315e_boot_sel_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning:
'rtd1315e_reset_n_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning:
'rtd1315e_scan_switch_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning:
'rtd1315e_testmode_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning:
'rtd1315e_wd_rset_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning:
'rtd1319d_boot_sel_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning:
'rtd1319d_reset_n_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning:
'rtd1319d_scan_switch_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning:
'rtd1319d_testmode_pins' defined but not used [-Wunused-const-variable=]
drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning:
'rtd1319d_wd_rset_pins' defined but not used [-Wunused-const-variable=]

Cc: Tzuyi Chang <tychang@realtek.com>
Link: https://lore.kernel.org/oe-kbuild-all/202309270313.mBEc9o1A-lkp@intel.com/
Link: https://lore.kernel.org/oe-kbuild-all/202309270448.7Aen3Sgx-lkp@intel.com/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231006-fix-realtek-warnings-v1-1-09af253312ba@linaro.org
drivers/pinctrl/realtek/pinctrl-rtd1315e.c
drivers/pinctrl/realtek/pinctrl-rtd1319d.c

index 5ab35d73e6f4646057842990af5eb7e368f57bd3..10afc736a52bb3698a25de5647ea9077caab3449 100644 (file)
@@ -227,8 +227,9 @@ static const struct pinctrl_pin_desc rtd1315e_iso_pins[] = {
        PINCTRL_PIN(RTD1315E_ISO_TESTMODE, "testmode"),
 };
 
+/* Tagged as __maybe_unused since there are pins we may use in the future */
 #define DECLARE_RTD1315E_PIN(_pin, _name) \
-       static const unsigned int rtd1315e_## _name ##_pins[] = { _pin }
+       static const unsigned int rtd1315e_## _name ##_pins[] __maybe_unused = { _pin }
 
 DECLARE_RTD1315E_PIN(RTD1315E_ISO_GPIO_0, gpio_0);
 DECLARE_RTD1315E_PIN(RTD1315E_ISO_GPIO_1, gpio_1);
index 838a447776ba036f0e3547992edbca58f58ba9ae..b1a654ac30dcff91e9a9d065751a6dda223f5636 100644 (file)
@@ -233,8 +233,9 @@ static const struct pinctrl_pin_desc rtd1319d_iso_pins[] = {
        PINCTRL_PIN(RTD1319D_ISO_TESTMODE, "testmode"),
 };
 
+/* Tagged as __maybe_unused since there are pins we may use in the future */
 #define DECLARE_RTD1319D_PIN(_pin, _name) \
-       static const unsigned int rtd1319d_## _name ##_pins[] = { _pin }
+       static const unsigned int rtd1319d_## _name ##_pins[] __maybe_unused = { _pin }
 
 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_0, gpio_0);
 DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_1, gpio_1);