From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Nathan Chancellor" <nathan@kernel.org>
Cc: "Conor Dooley" <conor.dooley@microchip.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Nicolai Buchwitz" <nb@tipi-net.de>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: macb: Move macb_{alloc,free}_tieoff() out of CONFIG_OF block
Date: Thu, 20 Aug 2026 19:12:02 +0200 [thread overview]
Message-ID: <DKTXSY8PDCPK.2GPXEF18NPNAB@bootlin.com> (raw)
In-Reply-To: <20260819185446.GA12505@ax162>
On Wed Aug 19, 2026 at 8:54 PM CEST, Nathan Chancellor wrote:
> On Wed, Aug 19, 2026 at 08:06:48PM +0200, Théo Lebrun wrote:
>> On Wed Aug 19, 2026 at 3:14 AM CEST, Nathan Chancellor wrote:
>> > Commit 5262eab9462a ("net: macb: allocate tieoff descriptor once across
>> > device lifetime") moved macb_alloc_tieoff() and macb_free_tieoff() into
>> > a CONFIG_OF block, breaking the build when it is disabled:
>>
>> That commit message is somewhat off: the commit created the two
>> functions, it didn't move them around. But indeed I was wrong in the
>
> Oh correct, I misread macb_init_tieoff() as macb_alloc_tieoff() so
> considered it a "move" but "placed" would definitely be more accurate.
>
>> location where I created them (argh I hate #if/ifdef blocks, especially
>> long ones).
>
> Yeah, I had to grep for the pairs because this one was so big.
>
>> Can reproduce using my host toolchain easily:
>>
>> ⟩ unset ARCH CROSS_COMPILE
>> ⟩ make mrproper
>> ⟩ make defconfig
>> ⟩ ./scripts/config -e COMMON_CLK -e MACB
>> ⟩ make olddefconfig
>> ⟩ make drivers/net/ethernet/cadence/
>> ⟩ echo $?
>> 2
>
> Yup, same exact reproducer I used.
>
>> Here is an alternative fix proposal: let's drop the #ifdef. It will
>> avoid any future error. Almost all drivers have no #ifdef as such:
>>
>> ⟩ git grep -l MODULE_DEVICE_TABLE drivers/ | wc -l
>> 7458
>> ⟩ git grep -l MODULE_DEVICE_TABLE drivers/ | xargs git grep -l CONFIG_OF | wc -l
>> 391
>>
>> Yes, I know this means the match table land in the module in !OF case.
>> Almost everyone on the ML I've seen seem to consider that it's trivial.
>> Apparently it's even useful because some ACPI can match on compatible,
>> somehow.
>>
>> Opinions?
>
> I am always in favor of dropping #ifdefs to make it easier to avoid
> compile issues like this. If that is the route we want to go, please
> feel free to send a patch for it (or I can if you prefer).
Done. Just sent now and noticed I forgot CCing you, sorry!
https://lore.kernel.org/netdev/20260820-macb-fix-x86-v1-1-b2e7c902104e@bootlin.com/
Thanks,
--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
prev parent reply other threads:[~2026-08-20 17:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 1:14 [PATCH net] net: macb: Move macb_{alloc,free}_tieoff() out of CONFIG_OF block Nathan Chancellor
2026-08-19 7:10 ` luoxuanqiang
2026-08-19 17:14 ` Nathan Chancellor
2026-08-19 7:39 ` Nicolai Buchwitz
2026-08-19 18:06 ` Théo Lebrun
2026-08-19 18:54 ` Nathan Chancellor
2026-08-20 17:12 ` Théo Lebrun [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DKTXSY8PDCPK.2GPXEF18NPNAB@bootlin.com \
--to=theo.lebrun@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor.dooley@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox