From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>
Subject: Re: [PATCH 00/17] drivers: replace strncpy with strlcpy
Date: Wed, 24 Jun 2026 08:49:01 +0100 [thread overview]
Message-ID: <ajuL7abo4gXYabyw@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20260623103309.50529876@phoenix.local>
On Tue, Jun 23, 2026 at 10:33:09AM -0700, Stephen Hemminger wrote:
> On Tue, 23 Jun 2026 17:51:30 +0100
> Bruce Richardson <bruce.richardson@intel.com> wrote:
>
> > Many uses of strncpy in DPDK drivers can be directly replaced by
> > a call to strlcpy instead, which is safer in that it always null-
> > terminates the string. This AI assisted patchset makes those
> > simple replacements, adjusting lengths as appropriate.
> >
> > After this set, there are still a number of drivers with strncpy calls
> > in them, but those are not simple strncpy->strlcpy replacements, so
> > left for later rework.
>
> Maybe a coccinelle script?
Don't think it's worth it.
a) All trivial replacements are already done by this set and the other
patches I've posted.
b) AI does a better job of handling this anyway, since it's able to
properly analyse the context and spot cases of using a length parameter one
short when calling strncpy, or when code is improved by using sizeof() as
the length parameter.
What probably is needed in scripting though, is a checkpatch check for new
strncpy additions. Are you still working on that python replacement?
/Bruce
next prev parent reply other threads:[~2026-06-24 7:49 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 16:51 [PATCH 00/17] drivers: replace strncpy with strlcpy Bruce Richardson
2026-06-23 16:51 ` [PATCH 01/17] common/cnxk: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 02/17] common/mlx5: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 03/17] crypto/mvsam: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 04/17] crypto/scheduler: " Bruce Richardson
2026-06-23 16:59 ` Bruce Richardson
2026-06-23 16:51 ` [PATCH 05/17] event/cnxk: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 06/17] net/ark: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 07/17] net/bnx2x: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 08/17] net/cnxk: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 09/17] net/dpaa: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 10/17] net/ionic: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 11/17] net/mlx4: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 12/17] net/mlx5: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 13/17] net/nfp: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 14/17] net/qede: " Bruce Richardson
2026-06-23 17:02 ` Bruce Richardson
2026-06-23 16:51 ` [PATCH 15/17] net/softnic: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 16/17] net/vhost: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 17/17] net/virtio: " Bruce Richardson
2026-06-23 17:33 ` [PATCH 00/17] drivers: " Stephen Hemminger
2026-06-24 7:49 ` Bruce Richardson [this message]
2026-06-24 10:36 ` [PATCH v2 " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 01/17] common/cnxk: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 02/17] common/mlx5: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 03/17] crypto/mvsam: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 04/17] crypto/scheduler: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 05/17] event/cnxk: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 06/17] net/ark: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 07/17] net/bnx2x: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 08/17] net/cnxk: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 09/17] net/dpaa: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 10/17] net/ionic: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 11/17] net/mlx4: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 12/17] net/mlx5: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 13/17] net/nfp: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 14/17] net/qede: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 15/17] net/softnic: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 16/17] net/vhost: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 17/17] net/virtio: " Bruce Richardson
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=ajuL7abo4gXYabyw@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.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