[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKmqyKOX8gcRT2dSOvJY2o4bpoF+VuPmhaygJj7pTb1KesrFOQ@mail.gmail.com>
Date: Tue, 5 Nov 2024 10:21:15 +1000
From: Alistair Francis <alistair23@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux@...linux.org.uk, hkallweit1@...il.com,
Alistair Francis <alistair.francis@....com>
Subject: Re: [PATCH] include: mdio: Guard inline function with CONFIG_MDIO
On Mon, Nov 4, 2024 at 11:49 PM Andrew Lunn <andrew@...n.ch> wrote:
>
> On Mon, Nov 04, 2024 at 05:09:50PM +1000, Alistair Francis wrote:
> > 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.
>
> Why? Are you fixing a linker error? A compiler error?
I'm investigating generating Rust bindings for static inline functions
(like mdio45_ethtool_gset() for example). But it fails to build when
there are functions defined in header files that call C functions that
aren't built due to Kconfig options.
This is one of those cases where mdio45_ethtool_gset() is always
included, but mdio45_ethtool_gset_npage() is conditionally built.
Alistair
>
> In general, we don't want #ifdef if they are not necessary, because
> they reduce the effectiveness of build testing.
>
> Andrew
Powered by blists - more mailing lists