[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241104070950.502719-1-alistair.francis@wdc.com>
Date: Mon, 4 Nov 2024 17:09:50 +1000
From: Alistair Francis <alistair23@...il.com>
To: linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Cc: linux@...linux.org.uk,
hkallweit1@...il.com,
andrew@...n.ch,
alistair23@...il.com,
Alistair Francis <alistair.francis@....com>
Subject: [PATCH] include: mdio: Guard inline function with CONFIG_MDIO
The static inline functions mdio45_ethtool_gset() and
mdio45_ethtool_ksettings_get() call mdio45_ethtool_gset_npage() and
mdio45_ethtool_ksettings_get_npage() which are both guarded by
CONFIG_MDIO. So let's only expose mdio45_ethtool_gset() and
mdio45_ethtool_ksettings_get() if CONFIG_MDIO is defined.
Signed-off-by: Alistair Francis <alistair.francis@....com>
---
include/linux/mdio.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index efeca5bd7600b..558311d9d7cad 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -165,11 +165,13 @@ extern int mdio_set_flag(const struct mdio_if_info *mdio,
bool sense);
extern int mdio45_links_ok(const struct mdio_if_info *mdio, u32 mmds);
extern int mdio45_nway_restart(const struct mdio_if_info *mdio);
+
+#ifdef CONFIG_MDIO
extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio,
struct ethtool_cmd *ecmd,
u32 npage_adv, u32 npage_lpa);
-extern void
-mdio45_ethtool_ksettings_get_npage(const struct mdio_if_info *mdio,
+
+extern void mdio45_ethtool_ksettings_get_npage(const struct mdio_if_info *mdio,
struct ethtool_link_ksettings *cmd,
u32 npage_adv, u32 npage_lpa);
@@ -205,6 +207,7 @@ mdio45_ethtool_ksettings_get(const struct mdio_if_info *mdio,
{
mdio45_ethtool_ksettings_get_npage(mdio, cmd, 0, 0);
}
+#endif
extern int mdio_mii_ioctl(const struct mdio_if_info *mdio,
struct mii_ioctl_data *mii_data, int cmd);
--
2.47.0
Powered by blists - more mailing lists