From: Zhu Wang <wangzhu9@huawei.com>
To: <andrzej.hajda@intel.com>, <neil.armstrong@linaro.org>,
<rfoss@kernel.org>, <Laurent.pinchart@ideasonboard.com>,
<jonas@kwiboo.se>, <jernej.skrabec@gmail.com>,
<airlied@gmail.com>, <daniel@ffwll.ch>,
<u.kleine-koenig@pengutronix.de>, <javierm@redhat.com>,
<dianders@chromium.org>, <benjamin.mugnier@foss.st.com>,
<kabel@kernel.org>, <anarsoul@gmail.com>, <duwe@suse.de>,
<mripard@kernel.org>, <dri-devel@lists.freedesktop.org>,
<linux-kernel@vger.kernel.org>
Cc: <wangzhu9@huawei.com>
Subject: [PATCH -next] drm/bridge: fix -Wunused-const-variable= warning
Date: Wed, 26 Jul 2023 18:06:26 +0800 [thread overview]
Message-ID: <20230726100626.167490-1-wangzhu9@huawei.com> (raw)
When building with W=1, the following warning occurs.
drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:48:17: warning: ‘anx781x_i2c_addresses’ defined but not used [-Wunused-const-variable=]
static const u8 anx781x_i2c_addresses[] = {
^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:40:17: warning: ‘anx7808_i2c_addresses’ defined but not used [-Wunused-const-variable=]
static const u8 anx7808_i2c_addresses[] = {
The definition of above two data variables is included by the
macro CONFIG_OF, so we also include the data variable
definitions in the macro CONFIG_OF. And in addition the data
variable anx78xx_match_table is included in the macro CONFIG_OF,
so we add CONFIG_OF to the place where it is used.
Fixes: 5d97408e0d70 ("drm/bridge: move ANA78xx driver to analogix subdirectory")
Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
---
drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
index 06a3e3243e19..799b33cebdd5 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
@@ -37,6 +37,7 @@
#define XTAL_CLK 270 /* 27M */
+#if IS_ENABLED(CONFIG_OF)
static const u8 anx7808_i2c_addresses[] = {
[I2C_IDX_TX_P0] = 0x78,
[I2C_IDX_TX_P1] = 0x7a,
@@ -52,6 +53,7 @@ static const u8 anx781x_i2c_addresses[] = {
[I2C_IDX_RX_P0] = 0x7e,
[I2C_IDX_RX_P1] = 0x80,
};
+#endif
struct anx78xx_platform_data {
struct regulator *dvdd10;
@@ -1387,7 +1389,9 @@ MODULE_DEVICE_TABLE(of, anx78xx_match_table);
static struct i2c_driver anx78xx_driver = {
.driver = {
.name = "anx7814",
+#if IS_ENABLED(CONFIG_OF)
.of_match_table = of_match_ptr(anx78xx_match_table),
+#endif
},
.probe = anx78xx_i2c_probe,
.remove = anx78xx_i2c_remove,
--
2.17.1
next reply other threads:[~2023-07-26 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-26 10:06 Zhu Wang [this message]
2023-07-26 10:54 ` Uwe Kleine-König
2023-07-26 11:30 ` Arnd Bergmann
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=20230726100626.167490-1-wangzhu9@huawei.com \
--to=wangzhu9@huawei.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=anarsoul@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=benjamin.mugnier@foss.st.com \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=duwe@suse.de \
--cc=javierm@redhat.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=kabel@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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
all inboxes | Powered by JetHome®