linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Tzuyi Chang <tychang@realtek.com>
Subject: [PATCH 1/2] pinctrl: realtek: Tag unused pins as __maybe_unused
Date: Fri, 06 Oct 2023 23:04:18 +0200	[thread overview]
Message-ID: <20231006-fix-realtek-warnings-v1-1-09af253312ba@linaro.org> (raw)
In-Reply-To: <20231006-fix-realtek-warnings-v1-0-09af253312ba@linaro.org>

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>
---
 drivers/pinctrl/realtek/pinctrl-rtd1315e.c | 3 ++-
 drivers/pinctrl/realtek/pinctrl-rtd1319d.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/realtek/pinctrl-rtd1315e.c b/drivers/pinctrl/realtek/pinctrl-rtd1315e.c
index 5ab35d73e6f4..10afc736a52b 100644
--- a/drivers/pinctrl/realtek/pinctrl-rtd1315e.c
+++ b/drivers/pinctrl/realtek/pinctrl-rtd1315e.c
@@ -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);
diff --git a/drivers/pinctrl/realtek/pinctrl-rtd1319d.c b/drivers/pinctrl/realtek/pinctrl-rtd1319d.c
index 838a447776ba..b1a654ac30dc 100644
--- a/drivers/pinctrl/realtek/pinctrl-rtd1319d.c
+++ b/drivers/pinctrl/realtek/pinctrl-rtd1319d.c
@@ -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);

-- 
2.34.1


  reply	other threads:[~2023-10-06 21:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 21:04 [PATCH 0/2] Fix some realtek driver warnings Linus Walleij
2023-10-06 21:04 ` Linus Walleij [this message]
2023-10-06 21:04 ` [PATCH 2/2] pinctrl: realtek: Fix some NULL dereference warnings Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231006-fix-realtek-warnings-v1-1-09af253312ba@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tychang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).