All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 0/5] string: strl(cat|cpy)
Date: Thu, 11 Mar 2021 00:15:40 -0500	[thread overview]
Message-ID: <20210311051545.1886333-1-seanga2@gmail.com> (raw)

This series adds support for strl(cat|cpy), and brings their implementations
in-line with what is documented in the Linux man pages. It also fixes some
potential (actual) fastboot bugs. Lastly, it adds a patman check to suggest
using these functions over strn(cat|cpy). I think these functions provide a much
better interface, which removes some footguns from U-Boot.

Changes in v2:
- Fix strlcpy return value
- Add implementation of strlcat
- Add test for strlcat
- Fix bug in fastboot
- Move check to u_boot_line

Sean Anderson (5):
  lib: string: Fix strlcpy return value
  lib: string: Implement strlcat
  test: Add test for strlcat
  fastboot: Fix possible buffer overrun
  checkpatch: Add warnings for using strn(cat|cpy)

 drivers/fastboot/fb_mmc.c       |   6 +-
 drivers/usb/dwc3/linux-compat.h |   6 --
 include/linux/string.h          |   3 +
 lib/string.c                    |  31 +++++++-
 scripts/checkpatch.pl           |   6 ++
 test/lib/Makefile               |   1 +
 test/lib/strlcat.c              | 126 ++++++++++++++++++++++++++++++++
 tools/patman/test_checkpatch.py |  14 +++-
 8 files changed, 179 insertions(+), 14 deletions(-)
 create mode 100644 test/lib/strlcat.c

-- 
2.30.1

             reply	other threads:[~2021-03-11  5:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11  5:15 Sean Anderson [this message]
2021-03-11  5:15 ` [PATCH v2 1/5] lib: string: Fix strlcpy return value Sean Anderson
2021-03-25  0:38   ` Simon Glass
2021-03-25  0:54     ` Sean Anderson
2021-03-25  2:40       ` Simon Glass
2021-03-25  0:53   ` Sean Anderson
2021-04-13 14:28   ` Tom Rini
2021-03-11  5:15 ` [PATCH v2 2/5] lib: string: Implement strlcat Sean Anderson
2021-03-25  0:38   ` Simon Glass
2021-04-13 14:28   ` Tom Rini
2021-03-11  5:15 ` [PATCH v2 3/5] test: Add test for strlcat Sean Anderson
2021-03-25  0:38   ` Simon Glass
2021-04-13 14:29   ` Tom Rini
2021-03-11  5:15 ` [PATCH v2 4/5] fastboot: Fix possible buffer overrun Sean Anderson
2021-04-13 14:29   ` Tom Rini
2021-03-11  5:15 ` [PATCH v2 5/5] checkpatch: Add warnings for using strn(cat|cpy) Sean Anderson
2021-03-25  0:38   ` Simon Glass
2021-04-13 14:29   ` Tom Rini

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=20210311051545.1886333-1-seanga2@gmail.com \
    --to=seanga2@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.