[U-Boot] [PATCH 3/4] mtd: nand: add Freescale NFC driver

Bill Pringlemeir bpringlemeir at nbsps.com
Wed Aug 13 19:11:36 CEST 2014


On 13 Aug 2014, stefan at agner.ch wrote:

> Funny is, the size is bigger in the first uninlined case... Maybe GCC
> inlined the function only for some calls, I did not checked that... 
>
> With if/else
> text	   data	    bss	    dec	    hex	filename
> 2395	   2904	      0	   5299	   14b3	drivers/mtd/nand/fsl_nfc.o

This is totally sensible.  In some cases, the function epilogue and
prologue are actually bigger than the function body.  Also, the implicit
call means that the caller must save some temporary registers (R0-R3).
For the simple nfc_read() and nfc_write(), I would expect the size to
get bigger if they are not inlined.  Especially, gcc can recognize that
the same memory location is being operated on and collapse the
accesses.

Anyways, thanks for showing that the previous code was depending too
much on compiler knowledge.  Your current plan sounds promising.

Regards,
Bill Pringlemeir.


More information about the U-Boot mailing list