mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 0/7] add proper strdup_const support
Date: Mon, 25 Nov 2024 16:29:20 +0100	[thread overview]
Message-ID: <20241125152927.546493-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2024-11-25 15:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-25 15:29 Ahmad Fatoum [this message]
2024-11-25 15:29 ` [PATCH 1/7] sandbox: hostfile: strdup device tree node names Ahmad Fatoum
2024-11-25 15:29 ` [PATCH 2/7] lds: implement is_barebox_rodata Ahmad Fatoum
2024-11-25 15:29 ` [PATCH 3/7] string: implement proper strdup_const/free_const Ahmad Fatoum
2024-11-25 15:29 ` [PATCH 4/7] treewide: replace basename with kbasename Ahmad Fatoum
2024-11-25 15:29 ` [PATCH 5/7] treewide: use strdup_const where appropriate Ahmad Fatoum
2024-11-25 15:29 ` [PATCH 6/7] fs: efi: replace allocation with local buffer Ahmad Fatoum
2024-11-25 15:29 ` [PATCH 7/7] cdev: fix string leaks in devfs links Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241125152927.546493-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox