Re: [PATCH v1 3/7] net/fsl: add ACPI support for mdio bus

From: Andy Shevchenko
Date: Tue Feb 04 2020 - 06:17:47 EST


On Tue, Feb 4, 2020 at 9:18 AM Calvin Johnson (OSS)
<calvin.johnson@xxxxxxxxxxx> wrote:
> > -----Original Message-----
> > From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> > Subject: Re: [PATCH v1 3/7] net/fsl: add ACPI support for mdio bus
> > On Fri, Jan 31, 2020 at 5:37 PM Calvin Johnson <calvin.johnson@xxxxxxx>
> > wrote:

...

> > > - snprintf(bus->id, MII_BUS_ID_SIZE, "%llx", (unsigned long
> > long)res.start);
> > > + snprintf(bus->id, MII_BUS_ID_SIZE, "%llx",
> > > + (unsigned long long)res->start);
> >
> > Why this has been touched?
>
> Without this change, I get:
> ---------------------------------------------------------
> drivers/net/ethernet/freescale/xgmac_mdio.c: In function 'xgmac_mdio_probe':
> drivers/net/ethernet/freescale/xgmac_mdio.c:269:27: error: request for member 'start' in something not a structure or union
> (unsigned long long)res.start);
> ^
> scripts/Makefile.build:265: recipe for target 'drivers/net/ethernet/freescale/xgmac_mdio.o' failed
> make[4]: *** [drivers/net/ethernet/freescale/xgmac_mdio.o] Error 1
> ---------------------------------------------------------

I see. Thanks.
Can you leave it one line as it was before?

...

> > (Hint: missed terminator)
> static const struct acpi_device_id xgmac_mdio_acpi_match[] = {
> { "NXP0006", 0 },
> { }
> };
> Is this what you meant?

Yes!

...

> > > + .acpi_match_table = ACPI_PTR(xgmac_mdio_acpi_match),
> >
> > ACPI_PTR is not needed otherwise you will get a compiler warning.
>
> No compiler warning was observed in both cases.

You mean you tried CONFIG_ACPI=n and didn't get a warning about unused
static variable?
Perhaps you may run `make W=1 ...`

> I can see other drivers using this macro.

They might have hidden same issue.

--
With Best Regards,
Andy Shevchenko