Skip to contentSkip to conversation

net: mvmdio: fix compilation warning

PATCH Applied Marcin Wojtas 3 participants 4 messages Nov 15, 2021 – Nov 17, 2021

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

PATCH 1/1 net: mvmdio: fix compilation warning

The kernel test robot reported a following issue:

Quoted 1 line
Quoted 1 line

drivers/net/ethernet/marvell/mvmdio.c:426:36: warning:

unused variable 'orion_mdio_acpi_match' [-Wunused-const-variable]

   static const struct acpi_device_id orion_mdio_acpi_match[] = {
                                      ^

1 warning generated.

Fix that by surrounding the variable by appropriate ifdef.

Fixes c54da4c1acb1 ("net: mvmdio: add ACPI support")
---
 drivers/net/ethernet/marvell/mvmdio.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/marvell/mvmdio.c +2 -0
index 62a97c46fba0..ef878973b859 100644
@@ -429,12 +429,14 @@ static const struct of_device_id orion_mdio_match[] = {
 };
 MODULE_DEVICE_TABLE(of, orion_mdio_match);
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id orion_mdio_acpi_match[] = {
 	{ "MRVL0100", BUS_TYPE_SMI },
 	{ "MRVL0101", BUS_TYPE_XSMI },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, orion_mdio_acpi_match);
+#endif
 
 static struct platform_driver orion_mdio_driver = {
 	.probe = orion_mdio_probe,
Signature · 1 line
2.29.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Marcin Wojtas

The kernel test robot reported a following issue:

Quoted 1 line
Quoted 1 line

drivers/net/ethernet/marvell/mvmdio.c:426:36: warning:

unused variable 'orion_mdio_acpi_match' [-Wunused-const-variable]
static const struct acpi_device_id orion_mdio_acpi_match[] = {

How come OF never gives these warning, just ACPI? If there something missing in ACPI which OF has?

Quoted 3 lines
Fixes c54da4c1acb1 ("net: mvmdio: add ACPI support")

Andrew

#2 lore raw

Hi Andrew,

pon., 15 lis 2021 o 20:35 Andrew Lunn <[email protected]> napisał(a):

Quoted 10 lines · Marcin Wojtas
Quoted 5 lines

The kernel test robot reported a following issue:

Quoted 1 line
Quoted 1 line

drivers/net/ethernet/marvell/mvmdio.c:426:36: warning:

unused variable 'orion_mdio_acpi_match' [-Wunused-const-variable]
static const struct acpi_device_id orion_mdio_acpi_match[] = {

How come OF never gives these warning, just ACPI? If there something missing in ACPI which OF has?

It was enough to compile mvebu_v7_defconfig with W=1 to get it (so CONFIG_ACPI disabled). There may be a similar case for config _OF, but I couldn't deselect it easily and compile mvmdio at the same time.

Quoted 7 lines
Quoted 4 lines
Fixes c54da4c1acb1 ("net: mvmdio: add ACPI support")

Thanks,
Marcin

#3 lore raw
In reply to Marcin Wojtas
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Mon, 15 Nov 2021 16:30:24 +0100 you wrote:

The kernel test robot reported a following issue:

Quoted 1 line
Quoted 1 line

drivers/net/ethernet/marvell/mvmdio.c:426:36: warning:

unused variable 'orion_mdio_acpi_match' [-Wunused-const-variable]

   static const struct acpi_device_id orion_mdio_acpi_match[] = {
                                      ^

1 warning generated.

[...]

Here is the summary with links:
- [net:] net: mvmdio: fix compilation warning

    https://git.kernel.org/netdev/net/c/2460386bef0b

You are awesome, thank you!

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