On Sun, 5 Nov 2023 at 19:26, Sean Anderson <sean...@gmail.com> wrote: > > Aligning addresses and sizes causes overhead which is unnecessary when we > are not loading from block devices. Remove bl_len when it is not needed. > > For example, on iot2050 we save 144 bytes with this patch (once the rest of > this series is applied): > > add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-144 (-144) > Function old new delta > spl_load_simple_fit 920 904 -16 > load_simple_fit 496 444 -52 > spl_spi_load_image 384 308 -76 > Total: Before=87431, After=87287, chg -0.16% > > We use panic() instead of BUILD_BUG_ON in spl_set_bl_len because we still > need to be able to compile it for things like mmc_load_image_raw_sector, > even if that function will not be used. > > Signed-off-by: Sean Anderson <sean...@gmail.com> > --- > > Changes in v6: > - New > > arch/arm/mach-imx/spl_imx_romapi.c | 8 ++++---- > arch/arm/mach-sunxi/spl_spi_sunxi.c | 2 +- > common/spl/Kconfig | 14 +++++++++++++- > common/spl/spl_blk_fs.c | 2 +- > common/spl/spl_fat.c | 2 +- > common/spl/spl_fit.c | 6 +++--- > common/spl/spl_imx_container.c | 10 +++++----- > common/spl/spl_legacy.c | 4 ++-- > common/spl/spl_mmc.c | 4 ++-- > common/spl/spl_nand.c | 6 +++--- > common/spl/spl_net.c | 2 +- > common/spl/spl_nor.c | 8 ++++---- > common/spl/spl_ram.c | 2 +- > common/spl/spl_semihosting.c | 2 +- > common/spl/spl_spi.c | 4 ++-- > common/spl/spl_ymodem.c | 2 +- > drivers/usb/gadget/f_sdp.c | 4 ++-- > include/spl.h | 25 +++++++++++++++++++++++++ > test/image/Kconfig | 1 + > test/image/spl_load.c | 9 ++++----- > test/image/spl_load_os.c | 2 +- > 21 files changed, 78 insertions(+), 41 deletions(-) >
Reviewed-by: Simon Glass <s...@chromium.org>