diff mbox series

[net:] net: mvmdio: fix compilation warning

Message ID 20211115153024.209083-1-mw@semihalf.com (mailing list archive)
State Accepted
Commit 2460386bef0b9b98b71728d3c173e15558b78d82
Delegated to: Netdev Maintainers
Headers show
Series [net:] net: mvmdio: fix compilation warning | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 2 this patch: 2
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Marcin Wojtas Nov. 15, 2021, 3:30 p.m. UTC
The kernel test robot reported a following issue:

>> 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")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 drivers/net/ethernet/marvell/mvmdio.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andrew Lunn Nov. 15, 2021, 7:35 p.m. UTC | #1
On Mon, Nov 15, 2021 at 04:30:24PM +0100, Marcin Wojtas wrote:
> The kernel test robot reported a following issue:
> 
> >> 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?

> Fixes: c54da4c1acb1 ("net: mvmdio: add ACPI support")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Marcin Wojtas Nov. 15, 2021, 10:56 p.m. UTC | #2
Hi Andrew,


pon., 15 lis 2021 o 20:35 Andrew Lunn <andrew@lunn.ch> napisał(a):
>
> On Mon, Nov 15, 2021 at 04:30:24PM +0100, Marcin Wojtas wrote:
> > The kernel test robot reported a following issue:
> >
> > >> 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.

>
> > Fixes: c54da4c1acb1 ("net: mvmdio: add ACPI support")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Marcin Wojtas <mw@semihalf.com>
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>

Thanks,
Marcin
patchwork-bot+netdevbpf@kernel.org Nov. 17, 2021, 3:10 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 15 Nov 2021 16:30:24 +0100 you wrote:
> The kernel test robot reported a following issue:
> 
> >> 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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
index 62a97c46fba0..ef878973b859 100644
--- a/drivers/net/ethernet/marvell/mvmdio.c
+++ b/drivers/net/ethernet/marvell/mvmdio.c
@@ -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,