Re: [PATCH net-next 09/16] net: mdio: Add Synopsys DW XPCS management interface support

Andrew Lunn
2023-12-06T17:01:53Z

> > You shouldn't use inline in C files, only in headers.
>
> Could you please clarify why? I failed to find such requirement in the
> coding style doc. Moreover there are multiple examples of using the
> static-inline-ers in the C files in the kernel including the net/mdio
> subsystem.

The compiler does a better job at deciding what to inline than we
humans do. If you can show the compiler is doing it wrong, then we
might accept them. But in general, netdev does not like inline in .C
file. Also, nothing in MDIO is hot path, it spends a lot of time
waiting for a slow bus. So inline is likely to just bloat the code for
no gain.

Andrew