From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bill Pringlemeir Date: Wed, 13 Aug 2014 13:11:36 -0400 Subject: [U-Boot] [PATCH 3/4] mtd: nand: add Freescale NFC driver In-Reply-To: <67d042b2f68a3b0329207452da02c7b1@agner.ch> (Stefan Agner's message of "Wed, 13 Aug 2014 18:27:14 +0200") References: <4ea124ab817db6e3dee2067aadd6db14643990f5.1407312577.git.stefan@agner.ch> <1407796426.7427.100.camel@snotra.buserror.net> <1380dbe3110cbf9359220a78d69e1896@agner.ch> <1407881820.7427.137.camel@snotra.buserror.net> <87wqadl3h6.fsf@nbsps.com> <7b41b54fe3f11a943b0ec63f2e44f573@agner.ch> <87sil0l8vj.fsf@nbsps.com> <67d042b2f68a3b0329207452da02c7b1@agner.ch> Message-ID: <87oavol3g7.fsf@nbsps.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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.