]> git.baikalelectronics.ru Git - uboot.git/commit
mmc: jz_mmc: Compile-out write support if disabled
authorEzequiel Garcia <ezequiel@collabora.com>
Mon, 7 Jan 2019 21:13:25 +0000 (18:13 -0300)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 16 Jan 2019 12:56:43 +0000 (13:56 +0100)
commiteb015ff865dc81a008a35ba978868ee8bb6a8745
tree7024450c0c826ded79397910355112f6a7cff866
parent85caa0a82ece60be4dc0e5ae372b19ec4b027669
mmc: jz_mmc: Compile-out write support if disabled

Do not build write support, unless it's enabled.

In the SPL case, this change will typically remove
precious bytes (as write support is most often
not needed in SPL).

This is important on this platform, where the maximum
SPL size is 14 KiB.

With gcc v7.3, this change saves 144 bytes producing:

size spl/u-boot-spl
   text    data     bss     dec     hex filename
   9240     752     712   10704    29d0 spl/u-boot-spl

To make the code easier to compile-out and more
readable, a pair of read_data/write_data helpers are created.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
drivers/mmc/jz_mmc.c