mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 15:37:23 +00:00
49f3a42edf
The size of the dynamic stack allocation here is bounded by the if() statement. However, just allocating the maximum size up-front and doing malloc() if necessary avoids code duplication (the i2c_setup_offset() until the invocation of ->xfer), and generates much better (smaller) code: bloat-o-meter drivers/i2c/i2c-uclass.o.{0,1} add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-144 (-144) Function old new delta dm_i2c_write 552 408 -144 Total: Before=3828, After=3684, chg -3.76% It also makes static analysis of maximum stack usage (using the .su files that are automatically generated during build) easier if there are no lines saying "dynamic". [This is not entirely equivalent to the existing code; this now uses the stack for len <= 64 rather than len <= 63, but that seems like a more natural limit.] Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Heiko Schocher <hs@denx.de> |
||
---|---|---|
.. | ||
muxes | ||
acpi_i2c.c | ||
acpi_i2c.h | ||
ast_i2c.c | ||
ast_i2c.h | ||
at91_i2c.c | ||
at91_i2c.h | ||
cros_ec_ldo.c | ||
cros_ec_tunnel.c | ||
davinci_i2c.c | ||
davinci_i2c.h | ||
designware_i2c.c | ||
designware_i2c.h | ||
designware_i2c_pci.c | ||
exynos_hs_i2c.c | ||
fsl_i2c.c | ||
i2c-cdns.c | ||
i2c-cortina.c | ||
i2c-cortina.h | ||
i2c-emul-uclass.c | ||
i2c-gpio.c | ||
i2c-microchip.c | ||
i2c-uclass.c | ||
i2c-uniphier-f.c | ||
i2c-uniphier.c | ||
i2c-versatile.c | ||
i2c_core.c | ||
ihs_i2c.c | ||
imx_lpi2c.c | ||
intel_i2c.c | ||
iproc_i2c.c | ||
iproc_i2c.h | ||
Kconfig | ||
kona_i2c.c | ||
lpc32xx_i2c.c | ||
Makefile | ||
meson_i2c.c | ||
mv_i2c.c | ||
mv_i2c.h | ||
mvtwsi.c | ||
mxc_i2c.c | ||
npcm-i2c.c | ||
nx_i2c.c | ||
ocores_i2c.c | ||
octeon_i2c.c | ||
omap24xx_i2c.c | ||
omap24xx_i2c.h | ||
rcar_i2c.c | ||
rcar_iic.c | ||
rk_i2c.c | ||
s3c24x0_i2c.c | ||
s3c24x0_i2c.h | ||
sandbox_i2c.c | ||
sh_i2c.c | ||
soft_i2c.c | ||
stm32f7_i2c.c | ||
sun6i_p2wi.c | ||
sun8i_rsb.c | ||
synquacer_i2c.c | ||
tegra186_bpmp_i2c.c | ||
tegra_i2c.c | ||
xilinx_xiic.c |