u-boot/drivers
Rasmus Villemoes 49f3a42edf i2c: avoid dynamic stack use in dm_i2c_write
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>
2022-07-19 13:46:28 +02:00
..
adc adc: meson-saradc: add AXG variant 2022-04-25 09:25:00 +02:00
ata ata: sata_sil: Remove useless BLK guard in sata_sil.h 2022-06-28 17:03:32 -04:00
axi WS cleanup: remove trailing empty lines 2021-09-30 08:08:56 -04:00
bios_emulator pci: Update dm_pci_bus_to_virt() parameters 2022-05-03 18:33:29 -04:00
block block: ide: Remove ide_preinit function 2022-06-28 17:03:32 -04:00
bootcount Convert CONFIG_SYS_BOOTCOUNT_LE et al to Kconfig 2022-07-07 14:01:09 -04:00
bus bus: ti-sysc: change in a normal driver 2021-03-22 19:23:27 +13:00
button button: adc: set state to pressed when the voltage is closest to nominal 2022-02-11 09:00:47 -05:00
cache drivers: cache: ncore: Disable snoop filter 2022-06-17 16:27:05 +08:00
clk clk: mtmips: add clock driver for MediaTek MT7621 SoC 2022-07-13 23:03:37 +02:00
core nman external-symbol improvements 2022-07-08 14:39:07 -04:00
cpu cpu: add CPU driver for microblaze 2022-06-24 14:16:00 +02:00
crypto crypto: nuvoton: Add NPCM7xx SHA driver 2022-06-22 21:30:05 -04:00
ddr Convert CONFIG_SYS_DDR_RAW_TIMING to Kconfig 2022-07-05 17:03:01 -04:00
demo demo: migrate uclass to livetree 2021-10-05 08:50:15 -04:00
dfu DFU: Check the number of arguments and argument string strictly 2022-02-11 11:29:23 -05:00
dma dma: ti: Add PSIL data for AM62x DMASS 2022-06-10 13:37:32 -04:00
fastboot fastboot: only look up real partition names when no alias exists 2022-01-28 11:30:39 -05:00
firmware spl: Ensure all SPL symbols in Kconfig have some SPL dependency 2022-07-07 09:29:08 -04:00
fpga Merge branch 'next' 2022-07-11 14:58:57 -04:00
fuzz sandbox: Implement fuzzing engine driver 2022-06-23 12:58:19 -04:00
gpio gpio: add support for MediaTek MT7621 SoC 2022-07-13 23:03:37 +02:00
hwspinlock treewide: invaild -> invalid 2022-01-13 07:57:49 -05:00
i2c i2c: avoid dynamic stack use in dm_i2c_write 2022-07-19 13:46:28 +02:00
input input: apple: Add support for Apple SPI keyboard 2022-02-10 16:44:23 -05:00
iommu iommu: Add M1 Pro/Max support to Apple DART driver 2022-02-21 08:35:40 -05:00
led led: pwm: Use NOP uclass driver for top-level node 2022-07-08 10:56:45 -04:00
mailbox mailbox: apple: Add driver for Apple IOP mailbox 2022-02-10 16:44:23 -05:00
memory keystone2: Move CONFIG_AEMIF_CNTRL_BASE out of CONFIG namespace 2021-09-27 21:38:34 -04:00
misc - Alignment with Linux kernel device tree v5.19 for stm32mp15 and stm32mp13 2022-07-13 08:09:20 -04:00
mmc mmc: mediatek: add support for MediaTek MT7621 SoC 2022-07-13 23:03:37 +02:00
mtd nand: raw: add support for MediaTek MT7621 SoC 2022-07-13 23:03:37 +02:00
mux treewide: invaild -> invalid 2022-01-13 07:57:49 -05:00
net net: mediatek: add support for MediaTek MT7621 SoC 2022-07-13 23:03:37 +02:00
nvme arm: apple: nvme: Add SART support and RTKit buffer management 2022-06-23 08:24:49 -04:00
pch treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
pci Convert CONFIG_SYS_FSL_PCI_VER_3_X to Kconfig 2022-07-05 17:05:00 -04:00
pci_endpoint dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
phy phy: mtk-tphy: add support for MediaTek MT7621 SoC 2022-07-13 23:03:37 +02:00
pinctrl pinctrl: mtmips: add support for MediaTek MT7621 SoC 2022-07-13 23:03:37 +02:00
power Merge branch 'next' 2022-07-11 14:58:57 -04:00
pwm Rename CONFIG_PWM to CONFIG_PWM_S5P and move to Kconfig 2022-07-05 17:03:01 -04:00
qe configs: fsl: migrate FMAN/QE specific defines to Kconfig 2021-11-09 17:18:23 +05:30
ram tpl: Ensure all TPL symbols in Kconfig have some TPL dependency 2022-06-28 17:03:31 -04:00
reboot-mode reboot-mode: migrate uclass to livetree 2021-10-05 08:50:15 -04:00
remoteproc remoteproc: ipu: Add driver to bring up ipu 2022-02-08 11:00:03 -05:00
reset reset/aspeed: Implement status callback 2022-07-06 14:30:51 -04:00
rng rng: stm32mp1_rng: add conditional reset feature for STM32MP13x 2022-07-12 11:47:34 +02:00
rtc test: Load mac address using RTC 2022-06-08 14:00:22 -04:00
scsi scsi: call device_probe() after scanning 2022-04-09 21:06:31 +02:00
serial serial: ns16550: Wait in debug_uart_init until tx buffer is empty 2022-07-08 12:20:04 -04:00
smem dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
soc soc: soc_ti_k3: identify j7200 SR2.0 SoCs 2022-07-06 14:30:51 -04:00
sound sound: enable building DA7219 driver with ACPIGEN=n 2022-07-08 09:05:47 -04:00
spi spi: add support for MediaTek MT7621 SoC 2022-07-13 23:03:37 +02:00
spmi spmi: msm: add arbiter version 5 support 2021-10-31 08:46:44 -04:00
sysinfo sysinfo: rcar3: Add Renesas R-Car Gen3 sysinfo driver 2021-07-20 23:33:54 +02:00
sysreset sysreset: socfpga: Use parent device for reading base address 2022-07-01 14:57:14 +08:00
tee drivers:optee:rpmb: initialize drivers of mmc devices in UCLASS_BLK for rpmb access 2022-06-06 18:01:21 -04:00
thermal WS cleanup: remove SPACE(s) followed by TAB 2021-09-30 09:08:16 -04:00
timer Xilinx changes for v2022.10 2022-06-27 10:15:50 -04:00
tpm tpm: add support for TPMv2.x I2C chips 2022-05-23 16:33:58 +03:00
ufs lib: fix selection of CONFIG_CHARSET 2022-05-03 21:39:22 +02:00
usb Merge https://source.denx.de/u-boot/custodians/u-boot-usb 2022-07-14 11:10:49 -04:00
video Merge branch 'next' 2022-07-11 14:58:57 -04:00
virtio virtio: rng: Check length before copying 2022-06-08 09:24:04 -04:00
w1 arm: Remove zmx25 board and ARCH_MX25 2021-10-01 21:08:18 -04:00
w1-eeprom dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
watchdog watchdog: add support for MediaTek MT7621 SoC 2022-07-13 23:03:37 +02:00
xen WS cleanup: remove trailing empty lines 2021-09-30 08:08:56 -04:00
Kconfig fuzzing_engine: Add fuzzing engine uclass 2022-06-23 12:58:18 -04:00
Makefile fuzzing_engine: Add fuzzing engine uclass 2022-06-23 12:58:18 -04:00