All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Julia Lawall <julia.lawall@inria.fr>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	cocci@systeme.lip6.fr
Subject: Re: [PULL REQUEST] i2c-for-5.20-part2
Date: Sun, 14 Aug 2022 04:02:53 +0200	[thread overview]
Message-ID: <YvhXzarjOLEJ8nsW@shikoro> (raw)
In-Reply-To: <YvhC5Orb+JeZFDEO@shikoro>

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]

On Sun, Aug 14, 2022 at 02:33:40AM +0200, Wolfram Sang wrote:
> 
> >  (b) auto-convert (with a coccinelle script) all the 'strlcpy()' users
> > that don't care about the return value, and leave a few broken users
> > of strlcpy around
> > 
> > I think (b) is the simpler thing, but I have no idea how to write a
> > coccinelle patch that basically does "if return value of strlcpy is
> > not used, convert the strlcpy to a strscpy".
> 
> That shouldn't be hard. I'll give it a try tomorrow.

So, I tried right away and it was really as easy as expected:

===
@@
@@
- strlcpy
+ strscpy
  (...);
===

The ';' at the end ensures that spatch only looks for complete
statements not containing anything more than expressed.

I pushed out a branch for the testbots now:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/strlcpy

Patch granularity might not be perfect currently, but for testing this
should do.

All the best,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-08-14  2:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-13 15:42 [PULL REQUEST] i2c-for-5.20-part2 Wolfram Sang
2022-08-13 21:37 ` Linus Torvalds
2022-08-14  0:33   ` Wolfram Sang
2022-08-14  2:02     ` Wolfram Sang [this message]
2022-08-14  4:30       ` Julia Lawall
2022-08-14  7:01       ` Wolfram Sang
2022-08-14 20:34         ` Wolfram Sang
2022-08-13 21:48 ` pr-tracker-bot

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=YvhXzarjOLEJ8nsW@shikoro \
    --to=wsa@kernel.org \
    --cc=cocci@systeme.lip6.fr \
    --cc=julia.lawall@inria.fr \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 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.