Re: [PULL REQUEST] i2c-for-5.20-part2
Wolfram Sang ` Linus Torvalds ` Wolfram Sang ` Wolfram Sang [this message] ` Julia Lawall ` Wolfram Sang ` Wolfram Sang ` pr-tracker-bot
From: | Wolfram Sang <wsa-AT-kernel.org> | |
To: | Linus Torvalds <torvalds-AT-linux-foundation.org>, Julia Lawall <julia.lawall-AT-inria.fr>, linux-i2c-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, cocci-AT-systeme.lip6.fr | |
Subject: | Re: [PULL REQUEST] i2c-for-5.20-part2 | |
Date: | Sun, 14 Aug 2022 04:02:53 +0200 | |
Message-ID: | <YvhXzarjOLEJ8nsW@shikoro> |
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: signature.asc (type=application/pgp-signature)-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmL4V8kACgkQFA3kzBSg KbaBCRAAmY5rNGESZ69ldZiKjdDXJGMee7pYez+og0TUy/CoQjOGr/QBEXYy75Ao OLaSW6yfpZRxpjkX2EYacMWubMgNPeQzaUPWNv6v1Lm67GCd0Hst/vwXRd3dgY1E bLFtwdYizANEbHfe0+RyD0ZKdvCAmC5CWlNZag1EToJQj1sh2oPZWcwCfBV2kE8D LH0a3i/r0KvqrnwB8ESdxliKxuUiPpG6Y9oZDVYCE/VyPN301kZaNKVIjNKLJLc6 XdKu72gDZWz+Ex85MCIUkKR9vSGrVMaL/lqUY4YdcIcu2htMTzUrK40GmRSPrWOR CfY2U6WXii6WLQU1P/yxru0FQc7oNkTG+J0cjyYI4ubdGlrz5RkxMp1So4VWgHvq DPtMFY34S7e69Ue5H3Wz6kiVzbS7P6ZVwvAb//hh/rkoA5QkQX6fjz80hVlSbHSJ gR/HNxtrbUqpxklk45fI8HBCvpFMhasNVCUQv/YsoyrkH4cjKHvUd4xz1bMJIunh HmQWeTrHjYWCji69MCE+n/rc5V10Yc9ZXDcoeh52NNMdwodQ1Lc+liEZMC1krKSp ItR/eDl+9APfhjx8Kjqt6/RuBqufyO3Kt7j3of+Kz0PfKHY1cAytqXuTH6WWZZ4G D662Mu77nAV4/JVOSOrfrYf3zzLtoO2gHrXiq7MDNwGFJEDcri4= =BsLP -----END PGP SIGNATURE-----