[PATCH] phy: dp83867: add dp83867_{read,write}_mmd helpers
Vladimir Oltean
vladimir.oltean at nxp.com
Thu May 19 16:38:07 CEST 2022
Hi Rasmus,
On Tue, May 17, 2022 at 04:27:06PM +0200, Rasmus Villemoes wrote:
> Since the phy_{read,write}_mmd functions are static inlines using
> other static inline functions, they cause code using them to explode.
>
> Defining local wrappers cuts the size of the generated code by 50%:
>
> $ size drivers/net/phy/dp83867.o.{before,after}
> text data bss dec hex filename
> 4873 112 0 4985 1379 drivers/net/phy/dp83867.o.before
> 2413 112 0 2525 9dd drivers/net/phy/dp83867.o.after
>
> Of course, most of that improvement could also be had by making the
> phy_*_mmd functions out-of-line, and they probably should be, but this
> still has the advantage of avoiding passing the DP83867_DEVADDR
> argument at all call sites, which allows lines to be unwrapped (and
> probably also gives a little .text reduction by itself).
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
> ---
Have you considered making phy_read_mmd() and phy_write_mmd() non-inline?
There are few users, but it looks like they would all benefit from this.
More information about the U-Boot
mailing list