RE: [PATCH net-next 2/5] net: fec: simplify the conditional preprocessor directives

From: Wei Fang

Date: Mon Nov 17 2025 - 22:05:17 EST


> > On Wed, Nov 12, 2025 at 01:53:15AM +0000, Wei Fang wrote:
> > > > > - if (!of_machine_is_compatible("fsl,imx6ul")) {
> > > > > - reg_list = fec_enet_register_offset;
> > > > > - reg_cnt = ARRAY_SIZE(fec_enet_register_offset);
> > > > > - } else {
> > > > > +
> > > > > +#if !defined(CONFIG_M5272) || defined(CONFIG_COMPILE_TEST)
> > > > > + if (of_machine_is_compatible("fsl,imx6ul")) {
> > > >
> > > > There are stub of_machine_is_compatible(), so needn't #ifdef here.
> > > >
> > >
> > > fec_enet_register_offset_6ul is not defined when CONFIG_M5272 is
> > > enabled, so we still need it here.
> >
> > Is it possible to remove ifdef for fec_enet_register_offset_6ul?
> >
>
> Yes, I will move fec_enet_register_offset_6ul out of the "#ifdef " guard.

Sorry, remove the guard for fec_enet_register_offset_6ul will cause
build errors, because there are many macros are not defined for M5272.
I'm going to use this version in v3.