Netdev List
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: "Théo Lebrun" <theo.lebrun@bootlin.com>
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: Wed, 19 Aug 2026 11:54:46 -0700	[thread overview]
Message-ID: <20260819185446.GA12505@ax162> (raw)
In-Reply-To: <DKT4CBU8YB5G.2W0766H2NU6Y8@bootlin.com>

Hi Théo,

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).

-- 
Cheers,
Nathan

      reply	other threads:[~2026-08-19 18:54 UTC|newest]

Thread overview: 6+ 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 [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=20260819185446.GA12505@ax162 \
    --to=nathan@kernel.org \
    --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=nb@tipi-net.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=theo.lebrun@bootlin.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