[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210209211256.111764-1-george.mccollister@gmail.com>
Date: Tue, 9 Feb 2021 15:12:55 -0600
From: George McCollister <george.mccollister@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>, netdev@...r.kernel.org,
George McCollister <george.mccollister@...il.com>
Subject: [PATCH net-next 1/2] net: dsa: xrs700x: fix unused warning for of_device_id
Fix unused variable warning that occurs when CONFIG_OF isn't defined by
adding __maybe_unused.
>> drivers/net/dsa/xrs700x/xrs700x_i2c.c:127:34: warning: unused
variable 'xrs700x_i2c_dt_ids' [-Wunused-const-variable]
static const struct of_device_id xrs700x_i2c_dt_ids[] = {
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: George McCollister <george.mccollister@...il.com>
---
drivers/net/dsa/xrs700x/xrs700x_i2c.c | 2 +-
drivers/net/dsa/xrs700x/xrs700x_mdio.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/xrs700x/xrs700x_i2c.c b/drivers/net/dsa/xrs700x/xrs700x_i2c.c
index 16a46a78a037..489d9385b4f0 100644
--- a/drivers/net/dsa/xrs700x/xrs700x_i2c.c
+++ b/drivers/net/dsa/xrs700x/xrs700x_i2c.c
@@ -121,7 +121,7 @@ static const struct i2c_device_id xrs700x_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, xrs700x_i2c_id);
-static const struct of_device_id xrs700x_i2c_dt_ids[] = {
+static const struct of_device_id __maybe_unused xrs700x_i2c_dt_ids[] = {
{ .compatible = "arrow,xrs7003e", .data = &xrs7003e_info },
{ .compatible = "arrow,xrs7003f", .data = &xrs7003f_info },
{ .compatible = "arrow,xrs7004e", .data = &xrs7004e_info },
diff --git a/drivers/net/dsa/xrs700x/xrs700x_mdio.c b/drivers/net/dsa/xrs700x/xrs700x_mdio.c
index a10ee28eb86e..3b3b78f20263 100644
--- a/drivers/net/dsa/xrs700x/xrs700x_mdio.c
+++ b/drivers/net/dsa/xrs700x/xrs700x_mdio.c
@@ -138,7 +138,7 @@ static void xrs700x_mdio_remove(struct mdio_device *mdiodev)
xrs700x_switch_remove(priv);
}
-static const struct of_device_id xrs700x_mdio_dt_ids[] = {
+static const struct of_device_id __maybe_unused xrs700x_mdio_dt_ids[] = {
{ .compatible = "arrow,xrs7003e", .data = &xrs7003e_info },
{ .compatible = "arrow,xrs7003f", .data = &xrs7003f_info },
{ .compatible = "arrow,xrs7004e", .data = &xrs7004e_info },
--
2.11.0
Powered by blists - more mailing lists