[PATCH 0/7] add proper strdup_const support

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Nov 25 07:29:20 PST 2024


We currently implement strdup_const as strdup, which is correct, but
leaves the benefits of a proper implementation on the table:
Reducing allocations for .rodata strings, which have static storage
duration anyway.

This series implements a proper strdup_const that avoids allocations in
that case.

Ahmad Fatoum (7):
  sandbox: hostfile: strdup device tree node names
  lds: implement is_barebox_rodata
  string: implement proper strdup_const/free_const
  treewide: replace basename with kbasename
  treewide: use strdup_const where appropriate
  fs: efi: replace allocation with local buffer
  cdev: fix string leaks in devfs links

 arch/arm/lib/pbl.lds.S                   |  4 ++-
 arch/arm/lib32/barebox.lds.S             |  4 ++-
 arch/arm/lib64/barebox.lds.S             |  4 ++-
 arch/kvx/cpu/barebox.lds.S               |  5 +++-
 arch/mips/lib/barebox.lds.S              |  4 ++-
 arch/mips/lib/pbl.lds.S                  |  4 ++-
 arch/mips/pbl/zbarebox.lds.S             |  4 ++-
 arch/openrisc/cpu/barebox.lds.S          |  4 ++-
 arch/powerpc/boards/pcm030/barebox.lds.S |  2 ++
 arch/powerpc/mach-mpc85xx/barebox.lds.S  |  2 ++
 arch/riscv/lib/barebox.lds.S             |  4 ++-
 arch/riscv/lib/pbl.lds.S                 |  4 ++-
 arch/sandbox/board/barebox.lds.S         |  2 ++
 arch/sandbox/board/hostfile.c            |  4 +--
 arch/x86/mach-efi/elf_ia32_efi.lds.S     |  2 ++
 arch/x86/mach-efi/elf_x86_64_efi.lds.S   |  2 ++
 commands/magicvar.c                      | 12 ++++----
 commands/menu.c                          |  6 ++--
 commands/nand.c                          |  4 +--
 commands/of_property.c                   | 12 ++++----
 commands/partition.c                     |  6 ++--
 commands/tftp.c                          |  5 ++--
 common/blspec.c                          |  8 ++---
 common/boot.c                            | 24 +++++++--------
 common/bootchooser.c                     |  6 ++--
 common/complete.c                        |  8 ++---
 common/elf.c                             |  2 +-
 common/env.c                             | 28 ++++++++---------
 common/file-list.c                       | 14 +++++----
 common/globalvar.c                       |  4 +--
 common/menu.c                            | 38 +++++++++++++-----------
 common/menutree.c                        |  4 +--
 common/poller.c                          |  4 +--
 common/resource.c                        |  8 ++---
 common/restart.c                         |  2 +-
 common/slice.c                           |  4 +--
 common/state/backend_storage.c           |  4 +--
 common/state/state.h                     |  2 +-
 common/state/state_variables.c           |  4 +--
 drivers/led/led-gpio.c                   |  6 ++--
 drivers/led/led-pwm.c                    |  2 +-
 drivers/nvmem/core.c                     |  4 +--
 drivers/of/base.c                        | 12 ++++----
 drivers/of/of_net.c                      |  2 +-
 drivers/regulator/core.c                 |  4 +--
 drivers/soc/kvx/kvx_socinfo.c            |  2 +-
 fs/bpkfs.c                               |  8 ++---
 fs/devfs-core.c                          |  5 +++-
 fs/efi.c                                 | 18 ++++++-----
 include/asm-generic/sections.h           | 18 +++++++++++
 include/blspec.h                         |  4 +--
 include/boot.h                           |  2 +-
 include/console.h                        |  2 +-
 include/digest.h                         |  4 +--
 include/dma.h                            |  5 ++++
 include/elf.h                            |  2 +-
 include/environment.h                    |  8 ++---
 include/file-list.h                      |  4 +--
 include/led.h                            |  2 +-
 include/linux/clk.h                      |  4 ++-
 include/linux/slab.h                     |  7 +++--
 include/linux/string.h                   |  5 ++++
 include/mci.h                            |  2 +-
 include/menu.h                           | 20 ++++++++-----
 include/net.h                            |  2 +-
 include/of.h                             |  6 ++--
 include/param.h                          |  2 +-
 include/poller.h                         |  2 +-
 include/slice.h                          |  2 +-
 include/stringlist.h                     |  4 +--
 lib/glob.c                               | 19 +++++++-----
 lib/parameter.c                          |  6 ++--
 lib/string.c                             | 28 +++++++++++++++++
 lib/stringlist.c                         |  6 ++--
 net/eth.c                                |  4 +--
 net/nfs.c                                |  8 ++---
 scripts/checkpatch.pl                    |  2 +-
 77 files changed, 309 insertions(+), 198 deletions(-)

-- 
2.39.5




More information about the barebox mailing list