Linux Documentation
 help / color / mirror / Atom feed
From: Manuel Ebner <manuelebner@mailbox.org>
To: David Laight <david.laight.linux@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>
Cc: andy.shevchenko@gmail.com, apw@canonical.com,
	dwaipayanray1@gmail.com,  joe@perches.com, kees@kernel.org,
	linux-doc@vger.kernel.org,  linux-kernel@vger.kernel.org,
	lukas.bulwahn@gmail.com, skhan@linuxfoundation.org,
		workflows@vger.kernel.org
Subject: Re: [PATCH 2/2] scripts: checkpatch.pl: add warning for strlcat()
Date: Tue, 12 May 2026 09:36:11 +0200	[thread overview]
Message-ID: <9bb5070ee87059ee37e7f7fa8606052cc9c1156e.camel@mailbox.org> (raw)
In-Reply-To: <20260511142745.7757b1b2@pumpkin>

On Mon, 2026-05-11 at 14:27 +0100, David Laight wrote:
> On Mon, 11 May 2026 06:12:36 -0600
> Jonathan Corbet <corbet@lwn.net> wrote:
> 
> > Manuel Ebner <manuelebner@mailbox.org> writes:
> > 
> > > add a warning for strlcat()
> > > 
> > > Signed-off-by: Manuel Ebner <manuelebner@mailbox.org>
> > > ---
> > >  scripts/checkpatch.pl | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > > 
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > index 0492d6afc9a1..ca1a8e67d529 100755
> > > --- a/scripts/checkpatch.pl
> > > +++ b/scripts/checkpatch.pl
> > > @@ -7085,6 +7085,12 @@ sub process {
> > >  			     "Prefer strscpy over strlcpy - see:
> > > https://github.com/KSPP/linux/issues/89\n" . $herecurr);

Here you can see the external urls already deployed. there are two more in 
the code blocks above.

> > >  		}
> > >  
> > > +# strlcat uses that should likely be
> > > +		if ($line =~ /\bstrlcat\s*\(/ && !is_userspace($realfile)) {
> > > +			WARN("STRLCAT",
> > > +			     "Prefer seq_buf_printf() over strlcat - see:
> > > https://github.com/KSPP/linux/issues/370\n" . $herecurr);
> > > +		}  
> > 
> > Using seq_buf_printf() requires switching over to the seq_buf API in
> > general, it is not just a simple substitution, so this advice may prove
> > unhelpful to many.
> 
> And I'm not sure the external url is a good idea.

It wasn't my idea originally. but I'm open to suggestions.

Manuel

> > 
> > jon
> > 

      reply	other threads:[~2026-05-12  7:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-10 16:49 [PATCH 0/2] Doc, scripts: facilitate phaseout of strlcat Manuel Ebner
2026-05-10 16:52 ` [PATCH 1/2] [PATCH 1/2] Doc: deprecated.rst: add strlcat() Manuel Ebner
2026-05-11 11:40   ` Geert Uytterhoeven
2026-05-11 13:26     ` David Laight
2026-05-11 19:07       ` Kees Cook
2026-05-11 20:34         ` David Laight
2026-05-10 16:54 ` Manuel Ebner
2026-05-10 17:32   ` Randy Dunlap
2026-05-12  8:52   ` Jani Nikula
2026-05-12 10:43     ` Manuel Ebner
2026-05-12 13:57       ` David Laight
2026-05-10 16:56 ` [PATCH 2/2] scripts: checkpatch.pl: add warning for strlcat() Manuel Ebner
2026-05-10 17:31   ` Randy Dunlap
2026-05-11 12:12   ` Jonathan Corbet
2026-05-11 13:27     ` David Laight
2026-05-12  7:36       ` Manuel Ebner [this message]

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=9bb5070ee87059ee37e7f7fa8606052cc9c1156e.camel@mailbox.org \
    --to=manuelebner@mailbox.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=apw@canonical.com \
    --cc=corbet@lwn.net \
    --cc=david.laight.linux@gmail.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=kees@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=skhan@linuxfoundation.org \
    --cc=workflows@vger.kernel.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