Re: [PATCH v6 18/19] treewide: s/\<strends\>/strsuffix/g
From: Alejandro Colomar
Date: Sun Nov 15 2026 - 11:23:48 EST
Hi Joe,
> Date: 2026-11-15 08:15:52-0800
> From: Joe Perches <joe@xxxxxxxxxxx>
>
> On Sat, 2026-11-14 at 16:24 +0100, Alejandro Colomar wrote:
> > Except for the changes to "lib/tests/string_kunit.c", this was
> > a scripted change:
> >
> > $ git ls-files \
> > | grep '\.[ch]$' \
> > | grep -v -e ^tools/ -e ^scripts/ -e ^include/ \
> > | xargs grep -l strends \
> > | xargs sed -i 's/strends/strsuffix/g';
>
> You should really use coccinelle (spatch)
For less trivial stuff, I'd go for a semantic patch, but given this is
a simple textual replacement, sed(1) seems simpler, and good enough.
Do you expect any differences between them?
> and this should probably be 2 patches.
Ok; I'll split them. I'll first adapt the tests, and then the script
will work fully automated.
>
> https://coccinelle.gitlabpages.inria.fr/website/docs/main_grammar016.html
>
> something like:
>
> @@
> expression a1;
> expression a2;
> @@
>
> - strends(a1, a2)
> + strsuffix(a1, a2)
Thanks for the semantic patch!
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es>
Attachment:
signature.asc
Description: PGP signature