All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] include: mdio: Guard inline function with CONFIG_MDIO
@ 2024-11-04  7:09 Alistair Francis
  2024-11-04 13:42 ` kernel test robot
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Alistair Francis @ 2024-11-04  7:09 UTC (permalink / raw)
  To: linux-kernel, netdev
  Cc: linux, hkallweit1, andrew, alistair23, Alistair Francis

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@wdc.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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-11-05  3:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04  7:09 [PATCH] include: mdio: Guard inline function with CONFIG_MDIO Alistair Francis
2024-11-04 13:42 ` kernel test robot
2024-11-04 13:49 ` Andrew Lunn
2024-11-05  0:21   ` Alistair Francis
2024-11-05  0:37     ` Andrew Lunn
2024-11-05  1:21       ` Alistair Francis
2024-11-05  3:02         ` Andrew Lunn
2024-11-04 13:53 ` kernel test robot
2024-11-04 22:31 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.