Skip to contentSkip to conversation

net: dsa: lantiq_gswip: mark OF related data as maybe unused

PATCH Applied Krzysztof Kozlowski 8 participants 29 messages Mar 11, 2023 – Mar 28, 2023

Subsystems (11)
lore
Share & tools
lore
#0 lore raw

PATCH 1/12 net: dsa: lantiq_gswip: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data unused:

drivers/net/dsa/lantiq_gswip.c:1888:34: error: ‘xway_gphy_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/dsa/lantiq_gswip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/lantiq_gswip.c +1 -1
index 05ecaa007ab1..3c76a1a14aee 100644
@@ -1885,7 +1885,7 @@ static const struct xway_gphy_match_data xrx300_gphy_data = {
 	.ge_firmware_name = "lantiq/xrx300_phy11g_a21.bin",
 };
 
-static const struct of_device_id xway_gphy_match[] = {
+static const struct of_device_id xway_gphy_match[] __maybe_unused = {
 	{ .compatible = "lantiq,xrx200-gphy-fw", .data = NULL },
 	{ .compatible = "lantiq,xrx200a1x-gphy-fw", .data = &xrx200a1x_gphy_data },
 	{ .compatible = "lantiq,xrx200a2x-gphy-fw", .data = &xrx200a2x_gphy_data },
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/12 net: dsa: lan9303: drop of_match_ptr for ID table

The driver will match mostly or only by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/dsa/lan9303_i2c.c:97:34: error: ‘lan9303_i2c_of_match’ defined but not used [-Werror=unused-const-variable=] drivers/net/dsa/lan9303_mdio.c:157:34: error: ‘lan9303_mdio_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/dsa/lan9303_i2c.c  | 2 +-
 drivers/net/dsa/lan9303_mdio.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/dsa/lan9303_i2c.c +1 -1
index 1cb41c36bd47..e8844820c3a9 100644
@@ -103,7 +103,7 @@ MODULE_DEVICE_TABLE(of, lan9303_i2c_of_match);
 static struct i2c_driver lan9303_i2c_driver = {
 	.driver = {
 		.name = "LAN9303_I2C",
-		.of_match_table = of_match_ptr(lan9303_i2c_of_match),
+		.of_match_table = lan9303_i2c_of_match,
 	},
 	.probe_new = lan9303_i2c_probe,
 	.remove = lan9303_i2c_remove,
drivers/net/dsa/lan9303_mdio.c +1 -1
index 4f33369a2de5..d8ab2b77d201 100644
@@ -164,7 +164,7 @@ MODULE_DEVICE_TABLE(of, lan9303_mdio_of_match);
 static struct mdio_driver lan9303_mdio_driver = {
 	.mdiodrv.driver = {
 		.name = "LAN9303_MDIO",
-		.of_match_table = of_match_ptr(lan9303_mdio_of_match),
+		.of_match_table = lan9303_mdio_of_match,
 	},
 	.probe  = lan9303_mdio_probe,
 	.remove = lan9303_mdio_remove,
Signature · 1 line
2.34.1
#2 lore raw

PATCH 3/12 net: dsa: seville_vsc9953: drop of_match_ptr for ID table

In reply to Krzysztof Kozlowski

The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/dsa/ocelot/seville_vsc9953.c:1070:34: error: ‘seville_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/dsa/ocelot/seville_vsc9953.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/ocelot/seville_vsc9953.c +1 -1
index 563ad338da25..96d4972a62f0 100644
@@ -1079,7 +1079,7 @@ static struct platform_driver seville_vsc9953_driver = {
 	.shutdown	= seville_shutdown,
 	.driver = {
 		.name		= "mscc_seville",
-		.of_match_table	= of_match_ptr(seville_of_match),
+		.of_match_table	= seville_of_match,
 	},
 };
 module_platform_driver(seville_vsc9953_driver);
Signature · 1 line
2.34.1
#3 lore raw

PATCH 4/12 net: dsa: ksz9477: drop of_match_ptr for ID table

In reply to Krzysztof Kozlowski

The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/dsa/microchip/ksz9477_i2c.c:84:34: error: ‘ksz9477_dt_ids’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/dsa/microchip/ksz9477_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/microchip/ksz9477_i2c.c +1 -1
index e315f669ec06..97a317263a2f 100644
@@ -117,7 +117,7 @@ MODULE_DEVICE_TABLE(of, ksz9477_dt_ids);
 static struct i2c_driver ksz9477_i2c_driver = {
 	.driver = {
 		.name	= "ksz9477-switch",
-		.of_match_table = of_match_ptr(ksz9477_dt_ids),
+		.of_match_table = ksz9477_dt_ids,
 	},
 	.probe_new = ksz9477_i2c_probe,
 	.remove	= ksz9477_i2c_remove,
Signature · 1 line
2.34.1
#4 lore raw

PATCH 5/12 net: dsa: ocelot: drop of_match_ptr for ID table

In reply to Krzysztof Kozlowski

The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/dsa/ocelot/ocelot_ext.c:143:34: error: ‘ocelot_ext_switch_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/dsa/ocelot/ocelot_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/ocelot/ocelot_ext.c +1 -1
index 063150659816..228737a32080 100644
@@ -149,7 +149,7 @@ MODULE_DEVICE_TABLE(of, ocelot_ext_switch_of_match);
 static struct platform_driver ocelot_ext_switch_driver = {
 	.driver = {
 		.name = "ocelot-ext-switch",
-		.of_match_table = of_match_ptr(ocelot_ext_switch_of_match),
+		.of_match_table = ocelot_ext_switch_of_match,
 	},
 	.probe = ocelot_ext_probe,
 	.remove = ocelot_ext_remove,
Signature · 1 line
2.34.1
maintainer Acked-by on v1 5/12
#5 lore raw

Re: [PATCH 05/12] net: dsa: ocelot: drop of_match_ptr for ID table

Quoted 27 lines · Krzysztof Kozlowski

The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/dsa/ocelot/ocelot_ext.c:143:34: error: ‘ocelot_ext_switch_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/dsa/ocelot/ocelot_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/ocelot/ocelot_ext.c +1 -1
index 063150659816..228737a32080 100644
@@ -149,7 +149,7 @@ MODULE_DEVICE_TABLE(of, ocelot_ext_switch_of_match);
 static struct platform_driver ocelot_ext_switch_driver = {
 	.driver = {
 		.name = "ocelot-ext-switch",
-		.of_match_table = of_match_ptr(ocelot_ext_switch_of_match),
+		.of_match_table = ocelot_ext_switch_of_match,
 	},
 	.probe = ocelot_ext_probe,
 	.remove = ocelot_ext_remove,
Signature · 1 line
2.34.1
#6 lore raw

PATCH 6/12 net: phy: ks8995: drop of_match_ptr for ID table

In reply to Krzysztof Kozlowski

The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/phy/spi_ks8995.c:156:34: error: ‘ks8895_spi_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/phy/spi_ks8995.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/spi_ks8995.c +1 -1
index d4202d40d47a..7196e927c2cd 100644
@@ -491,7 +491,7 @@ static void ks8995_remove(struct spi_device *spi)
 static struct spi_driver ks8995_driver = {
 	.driver = {
 		.name	    = "spi-ks8995",
-		.of_match_table = of_match_ptr(ks8895_spi_of_match),
+		.of_match_table = ks8895_spi_of_match,
 	},
 	.probe	  = ks8995_probe,
 	.remove	  = ks8995_remove,
Signature · 1 line
2.34.1
#7 lore raw

PATCH 7/12 net: ieee802154: adf7242: drop of_match_ptr for ID table

In reply to Krzysztof Kozlowski

The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/ieee802154/adf7242.c:1322:34: error: ‘adf7242_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/ieee802154/adf7242.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/adf7242.c +1 -1
index 5cf218c674a5..509acc86001c 100644
@@ -1336,7 +1336,7 @@ MODULE_DEVICE_TABLE(spi, adf7242_device_id);
 static struct spi_driver adf7242_driver = {
 	.id_table = adf7242_device_id,
 	.driver = {
-		   .of_match_table = of_match_ptr(adf7242_of_match),
+		   .of_match_table = adf7242_of_match,
 		   .name = "adf7242",
 		   .owner = THIS_MODULE,
 		   },
Signature · 1 line
2.34.1
maintainer Acked-by on v1 7/12
#8 lore raw

RE: [PATCH 07/12] net: ieee802154: adf7242: drop of_match_ptr for ID table

Quoted 23 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Samstag, 11. März 2023 18:33
To: Andrew Lunn <[email protected]>; Florian Fainelli <[email protected]>; Vladimir Oltean <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Hauke Mehrtens <[email protected]>; Woojung Huh <[email protected]>; [email protected]; Claudiu Manoil <[email protected]>; Alexandre Belloni <[email protected]>; Colin Foster <colin.foster@in- advantage.com>; Hennerich, Michael <[email protected]>; Alexander Aring <[email protected]>; Stefan Schmidt <[email protected]>; Miquel Raynal <[email protected]>; Heiner Kallweit <[email protected]>; Russell King <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Cc: Krzysztof Kozlowski <[email protected]>
Subject: [PATCH 07/12] net: ieee802154: adf7242: drop of_match_ptr for ID table

Quoted 8 lines

The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/ieee802154/adf7242.c:1322:34: error: ‘adf7242_of_match’
defined but not used [-Werror=unused-const-variable=]

Quoted 20 lines
---
 drivers/net/ieee802154/adf7242.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/adf7242.c +1 -2
index 5cf218c674a5..509acc86001c 100644
@@ -1336,7 +1336,7 @@ MODULE_DEVICE_TABLE(spi, adf7242_device_id);
 static struct spi_driver adf7242_driver = {
 	.id_table = adf7242_device_id,
 	.driver = {
-		   .of_match_table = of_match_ptr(adf7242_of_match),
+		   .of_match_table = adf7242_of_match,
 		   .name = "adf7242",
 		   .owner = THIS_MODULE,
 		   },
--

2.34.1

maintainer Acked-by on v1 7/12
#9 lore raw

Re: [PATCH 07/12] net: ieee802154: adf7242: drop of_match_ptr for ID table

In reply to Krzysztof Kozlowski

Hi Krzysztof,

[email protected] wrote on Sat, 11 Mar 2023 18:32:58 +0100:

Quoted 7 lines

The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/ieee802154/adf7242.c:1322:34: error: ‘adf7242_of_match’ defined but not used [-Werror=unused-const-variable=]

I see Stefan already acked most of the ieee802154 patches, but I didn't got notified for this one, so in case:

Quoted 9 lines
---
 drivers/net/ieee802154/adf7242.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/adf7242.c +0 -0
index 5cf218c674a5..509acc86001c 100644

drivers/net/ieee802154/adf7242.c MODULE_DEVICE_TABLE(spi, adf7242_device_id); · line 1342

Quoted 8 lines
drivers/net/ieee802154/adf7242.c +1 -1
@@ -1336,7 +1336,7 @@ MODULE_DEVICE_TABLE(spi, adf7242_device_id);
 static struct spi_driver adf7242_driver = {
 	.id_table = adf7242_device_id,
 	.driver = {
-		   .of_match_table = of_match_ptr(adf7242_of_match),
+		   .of_match_table = adf7242_of_match,
 		   .name = "adf7242",
 		   .owner = THIS_MODULE,
 		   },

Thanks,
Miquèl

maintainer
#10 lore raw

Re: [PATCH 07/12] net: ieee802154: adf7242: drop of_match_ptr for ID table

Hello.

Quoted 8 lines · Miquel Raynal

Hi Krzysztof,

[email protected] wrote on Sat, 11 Mar 2023 18:32:58 +0100:

Quoted 4 lines

The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

Quoted 6 lines
Quoted 3 lines

drivers/net/ieee802154/adf7242.c:1322:34: error: ‘adf7242_of_match’ defined but not used [-Werror=unused-const-variable=]

I see Stefan already acked most of the ieee802154 patches, but I didn't got notified for this one, so in case:

The reason I did not ack the two patches for adf7242 is that Michael as driver maintainer ack'ed them already.

I only handled the ones where we have no active maintainer, as a fallback.

regards
Stefan Schmidt

#11 lore raw

PATCH 8/12 net: ieee802154: mcr20a: drop of_match_ptr for ID table

In reply to Krzysztof Kozlowski

The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/ieee802154/mcr20a.c:1340:34: error: ‘mcr20a_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/ieee802154/mcr20a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/mcr20a.c +1 -1
index f53d185e0568..87abe3b46316 100644
@@ -1352,7 +1352,7 @@ MODULE_DEVICE_TABLE(spi, mcr20a_device_id);
 static struct spi_driver mcr20a_driver = {
 	.id_table = mcr20a_device_id,
 	.driver = {
-		.of_match_table = of_match_ptr(mcr20a_of_match),
+		.of_match_table = mcr20a_of_match,
 		.name	= "mcr20a",
 	},
 	.probe      = mcr20a_probe,
Signature · 1 line
2.34.1
maintainer Acked-by on v1 8/12
#12 lore raw

Re: [PATCH 08/12] net: ieee802154: mcr20a: drop of_match_ptr for ID table

Hello

Quoted 16 lines · Krzysztof Kozlowski

The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/ieee802154/mcr20a.c:1340:34: error: ‘mcr20a_of_match’ defined but not used [-Werror=unused-const-variable=]

---
  drivers/net/ieee802154/mcr20a.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/mcr20a.c +0 -0
index f53d185e0568..87abe3b46316 100644

drivers/net/ieee802154/mcr20a.c MODULE_DEVICE_TABLE(spi, mcr20a_device_id); · line 1358

Quoted 8 lines
drivers/net/ieee802154/mcr20a.c +1 -1
@@ -1352,7 +1352,7 @@ MODULE_DEVICE_TABLE(spi, mcr20a_device_id);
  static struct spi_driver mcr20a_driver = {
  	.id_table = mcr20a_device_id,
  	.driver = {
-		.of_match_table = of_match_ptr(mcr20a_of_match),
+		.of_match_table = mcr20a_of_match,
  		.name	= "mcr20a",
  	},
  	.probe      = mcr20a_probe,

regards
Stefan Schmidt

#13 lore raw

PATCH 9/12 net: ieee802154: at86rf230: drop of_match_ptr for ID table

In reply to Krzysztof Kozlowski

The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/ieee802154/at86rf230.c:1644:34: error: ‘at86rf230_of_match’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/ieee802154/at86rf230.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/at86rf230.c +1 -1
index 62b984f84d9f..164c7f605af5 100644
@@ -1662,7 +1662,7 @@ MODULE_DEVICE_TABLE(spi, at86rf230_device_id);
 static struct spi_driver at86rf230_driver = {
 	.id_table = at86rf230_device_id,
 	.driver = {
-		.of_match_table = of_match_ptr(at86rf230_of_match),
+		.of_match_table = at86rf230_of_match,
 		.name	= "at86rf230",
 	},
 	.probe      = at86rf230_probe,
Signature · 1 line
2.34.1
maintainer Acked-by on v1 9/12
#14 lore raw

Re: [PATCH 09/12] net: ieee802154: at86rf230: drop of_match_ptr for ID table

Hello.

Quoted 16 lines · Krzysztof Kozlowski

The driver will match mostly by DT table (even thought there is regular ID table) so there is little benefit in of_match_ptr (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/ieee802154/at86rf230.c:1644:34: error: ‘at86rf230_of_match’ defined but not used [-Werror=unused-const-variable=]

---
  drivers/net/ieee802154/at86rf230.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/at86rf230.c +0 -0
index 62b984f84d9f..164c7f605af5 100644

drivers/net/ieee802154/at86rf230.c MODULE_DEVICE_TABLE(spi, at86rf230_device_id); · line 1668

Quoted 8 lines
drivers/net/ieee802154/at86rf230.c +1 -1
@@ -1662,7 +1662,7 @@ MODULE_DEVICE_TABLE(spi, at86rf230_device_id);
  static struct spi_driver at86rf230_driver = {
  	.id_table = at86rf230_device_id,
  	.driver = {
-		.of_match_table = of_match_ptr(at86rf230_of_match),
+		.of_match_table = at86rf230_of_match,
  		.name	= "at86rf230",
  	},
  	.probe      = at86rf230_probe,

regards
Stefan Schmidt

#15 lore raw

PATCH 10/12 net: ieee802154: ca8210: drop of_match_ptr for ID table

In reply to Krzysztof Kozlowski

The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/ieee802154/ca8210.c:3174:34: error: ‘ca8210_of_ids’ defined but not used [-Werror=unused-const-variable=]

---
 drivers/net/ieee802154/ca8210.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/ca8210.c +1 -1
index ed6cb79072a8..65d28e8a87c9 100644
@@ -3181,7 +3181,7 @@ static struct spi_driver ca8210_spi_driver = {
 	.driver = {
 		.name =                 DRIVER_NAME,
 		.owner =                THIS_MODULE,
-		.of_match_table =       of_match_ptr(ca8210_of_ids),
+		.of_match_table =       ca8210_of_ids,
 	},
 	.probe  =                       ca8210_probe,
 	.remove =                       ca8210_remove
Signature · 1 line
2.34.1
maintainer Acked-by on v1 10/12
#16 lore raw

Re: [PATCH 10/12] net: ieee802154: ca8210: drop of_match_ptr for ID table

Hello.

Quoted 16 lines · Krzysztof Kozlowski

The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it might not be relevant here).

drivers/net/ieee802154/ca8210.c:3174:34: error: ‘ca8210_of_ids’ defined but not used [-Werror=unused-const-variable=]

---
  drivers/net/ieee802154/ca8210.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/ca8210.c +0 -0
index ed6cb79072a8..65d28e8a87c9 100644

drivers/net/ieee802154/ca8210.c static struct spi_driver ca8210_spi_driver = { · line 3187

Quoted 8 lines
drivers/net/ieee802154/ca8210.c +1 -1
@@ -3181,7 +3181,7 @@ static struct spi_driver ca8210_spi_driver = {
  	.driver = {
  		.name =                 DRIVER_NAME,
  		.owner =                THIS_MODULE,
-		.of_match_table =       of_match_ptr(ca8210_of_ids),
+		.of_match_table =       ca8210_of_ids,
  	},
  	.probe  =                       ca8210_probe,
  	.remove =                       ca8210_remove

regards
Stefan Schmidt

#17 lore raw

PATCH 11/12 net: ieee802154: adf7242: drop owner from driver

In reply to Krzysztof Kozlowski

Core already sets owner in spi_driver.

---
 drivers/net/ieee802154/adf7242.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ieee802154/adf7242.c +0 -1
index 509acc86001c..f9972b8140f9 100644
@@ -1338,7 +1338,6 @@ static struct spi_driver adf7242_driver = {
 	.driver = {
 		   .of_match_table = adf7242_of_match,
 		   .name = "adf7242",
-		   .owner = THIS_MODULE,
 		   },
 	.probe = adf7242_probe,
 	.remove = adf7242_remove,
Signature · 1 line
2.34.1
maintainer Acked-by on v1 11/12
#18 lore raw

RE: [PATCH 11/12] net: ieee802154: adf7242: drop owner from driver

Quoted 22 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Samstag, 11. März 2023 18:33
To: Andrew Lunn <[email protected]>; Florian Fainelli <[email protected]>; Vladimir Oltean <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Hauke Mehrtens <[email protected]>; Woojung Huh <[email protected]>; [email protected]; Claudiu Manoil <[email protected]>; Alexandre Belloni <[email protected]>; Colin Foster <colin.foster@in- advantage.com>; Hennerich, Michael <[email protected]>; Alexander Aring <[email protected]>; Stefan Schmidt <[email protected]>; Miquel Raynal <[email protected]>; Heiner Kallweit <[email protected]>; Russell King <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Cc: Krzysztof Kozlowski <[email protected]>
Subject: [PATCH 11/12] net: ieee802154: adf7242: drop owner from driver

Quoted 3 lines

Core already sets owner in spi_driver.

Quoted 19 lines
---
 drivers/net/ieee802154/adf7242.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ieee802154/adf7242.c +0 -2
index 509acc86001c..f9972b8140f9 100644
@@ -1338,7 +1338,6 @@ static struct spi_driver adf7242_driver = {
 	.driver = {
 		   .of_match_table = adf7242_of_match,
 		   .name = "adf7242",
-		   .owner = THIS_MODULE,
 		   },
 	.probe = adf7242_probe,
 	.remove = adf7242_remove,
--

2.34.1

maintainer Acked-by on v1 11/12
#19 lore raw

Re: [PATCH 11/12] net: ieee802154: adf7242: drop owner from driver

In reply to Krzysztof Kozlowski

Hi Krzysztof,

[email protected] wrote on Sat, 11 Mar 2023 18:33:02 +0100:

Quoted 3 lines

Core already sets owner in spi_driver.

Same here:

Quoted 9 lines
---
 drivers/net/ieee802154/adf7242.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ieee802154/adf7242.c +0 -0
index 509acc86001c..f9972b8140f9 100644

drivers/net/ieee802154/adf7242.c static struct spi_driver adf7242_driver = { · line 1343

Quoted 7 lines
drivers/net/ieee802154/adf7242.c +0 -1
@@ -1338,7 +1338,6 @@ static struct spi_driver adf7242_driver = {
 	.driver = {
 		   .of_match_table = adf7242_of_match,
 		   .name = "adf7242",
-		   .owner = THIS_MODULE,
 		   },
 	.probe = adf7242_probe,
 	.remove = adf7242_remove,

Thanks,
Miquèl

#20 lore raw

PATCH 12/12 net: ieee802154: ca8210: drop owner from driver

In reply to Krzysztof Kozlowski

Core already sets owner in spi_driver.

---
 drivers/net/ieee802154/ca8210.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ieee802154/ca8210.c +0 -1
index 65d28e8a87c9..ca1fa56cca68 100644
@@ -3180,7 +3180,6 @@ MODULE_DEVICE_TABLE(of, ca8210_of_ids);
 static struct spi_driver ca8210_spi_driver = {
 	.driver = {
 		.name =                 DRIVER_NAME,
-		.owner =                THIS_MODULE,
 		.of_match_table =       ca8210_of_ids,
 	},
 	.probe  =                       ca8210_probe,
Signature · 1 line
2.34.1
maintainer Acked-by on v1 12/12
#21 lore raw

Re: [PATCH 12/12] net: ieee802154: ca8210: drop owner from driver

Hello.

Quoted 12 lines · Krzysztof Kozlowski

Core already sets owner in spi_driver.

---
  drivers/net/ieee802154/ca8210.c | 1 -
  1 file changed, 1 deletion(-)
drivers/net/ieee802154/ca8210.c +0 -0
index 65d28e8a87c9..ca1fa56cca68 100644

drivers/net/ieee802154/ca8210.c MODULE_DEVICE_TABLE(of, ca8210_of_ids); · line 3185

Quoted 7 lines
drivers/net/ieee802154/ca8210.c +0 -1
@@ -3180,7 +3180,6 @@ MODULE_DEVICE_TABLE(of, ca8210_of_ids);
  static struct spi_driver ca8210_spi_driver = {
  	.driver = {
  		.name =                 DRIVER_NAME,
-		.owner =                THIS_MODULE,
  		.of_match_table =       ca8210_of_ids,
  	},
  	.probe  =                       ca8210_probe,

regards
Stefan Schmidt

maintainer
#22 lore raw
In reply to Krzysztof Kozlowski
Quoted 7 lines · Krzysztof Kozlowski

The driver can be compile tested with !CONFIG_OF making certain data unused:

drivers/net/dsa/lantiq_gswip.c:1888:34: error: ‘xway_gphy_match’ defined but not used [-Werror=unused-const-variable=]

---

Do you happen to have any context as to why of_match_node() without CONFIG_OF is implemented as:

#define of_match_node(_matches, _node) NULL

and not as:

static inline const struct of_device_id *
of_match_node(const struct of_device_id *matches,
const struct device_node *node)

{
	return NULL;
}

?

Generally, the static inline shim function model is nicer, because it allows us to not scatter __maybe_unused all around.

#23 lore raw
Quoted 19 lines · Vladimir Oltean
Quoted 7 lines · Krzysztof Kozlowski

The driver can be compile tested with !CONFIG_OF making certain data unused:

drivers/net/dsa/lantiq_gswip.c:1888:34: error: ‘xway_gphy_match’ defined but not used [-Werror=unused-const-variable=]

---

Do you happen to have any context as to why of_match_node() without CONFIG_OF is implemented as:

#define of_match_node(_matches, _node) NULL

and not as:

static inline const struct of_device_id *
of_match_node(const struct of_device_id *matches,
const struct device_node *node)

Quoted 8 lines
{
	return NULL;
}

?

Generally, the static inline shim function model is nicer, because it allows us to not scatter __maybe_unused all around.

Sorry, I don't follow. I don't touch that wrappers, just fix errors related to OF device ID tables, although in few cases it is indeed related to of_match_node.

Best regards,
Krzysztof

maintainer
#24 lore raw
Quoted 24 lines · Krzysztof Kozlowski
Quoted 23 lines · Vladimir Oltean
Quoted 7 lines · Krzysztof Kozlowski

The driver can be compile tested with !CONFIG_OF making certain data unused:

drivers/net/dsa/lantiq_gswip.c:1888:34: error: ‘xway_gphy_match’ defined but not used [-Werror=unused-const-variable=]

---

Do you happen to have any context as to why of_match_node() without CONFIG_OF is implemented as:

#define of_match_node(_matches, _node) NULL

and not as:

static inline const struct of_device_id *
of_match_node(const struct of_device_id *matches,
const struct device_node *node)

{
	return NULL;
}
Quoted 8 lines
Quoted 4 lines

?

Generally, the static inline shim function model is nicer, because it allows us to not scatter __maybe_unused all around.

Sorry, I don't follow. I don't touch that wrappers, just fix errors related to OF device ID tables, although in few cases it is indeed related to of_match_node.

I'm saying this because in lantiq_gswip.c, xway_gphy_match is accessed through of_match_node(). If the shim definition for of_match_node() was different, the variable wouldn't have been unused with CONFIG_OF=n. I guess it's worth considering changing that wrapper instead of adding the __maybe_unused.

maintainer
#25 lore raw
Quoted 9 lines · On Sun, 12 Mar 2023 12:57:29 +0200 Vladimir Oltean wrote:
Quoted 3 lines

Sorry, I don't follow. I don't touch that wrappers, just fix errors related to OF device ID tables, although in few cases it is indeed related to of_match_node.

I'm saying this because in lantiq_gswip.c, xway_gphy_match is accessed through of_match_node(). If the shim definition for of_match_node() was different, the variable wouldn't have been unused with CONFIG_OF=n. I guess it's worth considering changing that wrapper instead of adding the __maybe_unused.

Hi Krzysztof, have you had a chance to check if using an empty static inline is enough to silence the compiler? Seems like it could save us quite some churn? Or do we want the of_match_node() decorations to go away in general?

#26 lore raw
Quoted 11 lines · Jakub Kicinski
Quoted 9 lines · On Sun, 12 Mar 2023 12:57:29 +0200 Vladimir Oltean wrote:
Quoted 3 lines

Sorry, I don't follow. I don't touch that wrappers, just fix errors related to OF device ID tables, although in few cases it is indeed related to of_match_node.

I'm saying this because in lantiq_gswip.c, xway_gphy_match is accessed through of_match_node(). If the shim definition for of_match_node() was different, the variable wouldn't have been unused with CONFIG_OF=n. I guess it's worth considering changing that wrapper instead of adding the __maybe_unused.

Quoted 4 lines

Hi Krzysztof, have you had a chance to check if using an empty static inline is enough to silence the compiler? Seems like it could save us quite some churn? Or do we want the of_match_node() decorations to go away in general?

I am pretty sure fixing of_match_node() and of_match_ptr() (independent case) would supersed this patchset, but it is a bit bigger change than I have available time now. I didn't try it yet.

Best regards,
Krzysztof

#27 lore raw
In reply to Krzysztof Kozlowski
This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Quoted 8 lines · On Sat, 11 Mar 2023 18:32:52 +0100 you wrote:

The driver can be compile tested with !CONFIG_OF making certain data unused:

drivers/net/dsa/lantiq_gswip.c:1888:34: error: ‘xway_gphy_match’ defined but not used [-Werror=unused-const-variable=]

[...]

Here is the summary with links:
- [01/12] net: dsa: lantiq_gswip: mark OF related data as maybe unused

    https://git.kernel.org/netdev/net-next/c/6ea1e67788f3
  - [02/12] net: dsa: lan9303: drop of_match_ptr for ID table
    https://git.kernel.org/netdev/net-next/c/ced5c5a0a2ea
  - [03/12] net: dsa: seville_vsc9953: drop of_match_ptr for ID table
    https://git.kernel.org/netdev/net-next/c/1eb8566dd08d
  - [04/12] net: dsa: ksz9477: drop of_match_ptr for ID table
    https://git.kernel.org/netdev/net-next/c/00923ff2e1ba
  - [05/12] net: dsa: ocelot: drop of_match_ptr for ID table
    https://git.kernel.org/netdev/net-next/c/0f17b42827ae
  - [06/12] net: phy: ks8995: drop of_match_ptr for ID table
    https://git.kernel.org/netdev/net-next/c/b0b7d1b6260b
  - [07/12] net: ieee802154: adf7242: drop of_match_ptr for ID table
    https://git.kernel.org/netdev/net-next/c/3df09beef650
  - [08/12] net: ieee802154: mcr20a: drop of_match_ptr for ID table
    https://git.kernel.org/netdev/net-next/c/3896c40b7824
  - [09/12] net: ieee802154: at86rf230: drop of_match_ptr for ID table
    https://git.kernel.org/netdev/net-next/c/32b7030681a4
  - [10/12] net: ieee802154: ca8210: drop of_match_ptr for ID table
    https://git.kernel.org/netdev/net-next/c/cdfe4fc4d946
  - [11/12] net: ieee802154: adf7242: drop owner from driver
    https://git.kernel.org/netdev/net-next/c/059fa9972340
  - [12/12] net: ieee802154: ca8210: drop owner from driver
    https://git.kernel.org/netdev/net-next/c/613a3c44a373

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html