Coccinelle commits for 6.10

One patch slightly improves the text in a comment.
 
 The other patch (on minmax.cocci) removes a report about ? being used in
 return statements that has been generating not very useful suggestions
 to change idiomatic code.
 
 Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEnGZC8gbRfLXdcpA0F+92B3f5RZ0FAmZLtOcACgkQF+92B3f5
 RZ3fjBAAhWqPJSWKpORkjMMEil0aO+LknyW9aOPUgEwLLIw3Qhji2/12MRhp0CnG
 fMBPccXjsdsqRBmmjOTMmN4q0aZk/7s7+MmcZMTwQWS6zYtbiJj/OMdKbghWeiOx
 kap/HN5u6KEEdYljaOdLanXG8a38+9Wd7RQuxbUCUSHh1RDazcgqkZrZa4VpE6dT
 oGT6b+35056bZe9s1TvMLOFAAnipF/lm6WJIzIrxKm5HsE8C+UWDorlEQ0LXnsQn
 vuvGIgiQFVLSskt3hWk/0hbRFByHQ335Cc6umohoOYK9ppVqtQp499AwunQlQq/L
 fiI3duuAdUPl6VWKBI6C2CaWo1cS2e/JdWnYHiZop5CRYP1S6MY0d3AWOxyE3/KK
 EiJFi3fce1K6Z95lr9TK29tbc0Bp/ghs8S2ge58eYzcPVd8bEuk0+k7b10gZew8i
 TniDIduDYvSOhhhFwPfrrapBGmajw572/t+h2W9EBCZhBHmNLk1l+mHBrTP3JhdA
 3IFPfjO6FO8ayTM7IEeiQr4EOXqGp/6A4ty/cHlmggdIg+OhyJ5RgUvAktnQeBM2
 TApYj+bR45dXxkh0WTLxCSTvsbpvRoF9uhEkFMP9mF+wS3Uq8PRCbsHvW5ujQqrs
 EocU/3tuED3GMFNVASG77Zkler4UUXUNr3FCKHsDnSYc1Hz6iVg=
 =EDrr
 -----END PGP SIGNATURE-----

Merge tag 'cocci-for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux

Pull coccinelle updates from Julia Lawall:
 "One patch slightly improves the text in a comment.

  The other patch (on minmax.cocci) removes a report about ? being used
  in return statements that has been generating not very useful
  suggestions to change idiomatic code"

* tag 'cocci-for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
  Coccinelle: pm_runtime: Fix grammar in comment
  coccinelle: misc: minmax: Suppress reports for err returns
This commit is contained in:
Linus Torvalds 2024-05-20 16:00:04 -07:00
commit 8f6a15f095
2 changed files with 17 additions and 17 deletions

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/// Make sure pm_runtime_* calls does not use unnecessary IS_ERR_VALUE
/// Make sure pm_runtime_* calls do not unnecessarily use IS_ERR_VALUE
///
// Keywords: pm_runtime
// Confidence: Medium

View File

@ -50,11 +50,26 @@ func(...)
...>
}
// Ignore errcode returns.
@errcode@
position p;
identifier func;
expression x;
binary operator cmp = {<, <=};
@@
func(...)
{
<...
return ((x) cmp@p 0 ? (x) : 0);
...>
}
@rmin depends on !patch@
identifier func;
expression x, y;
binary operator cmp = {<, <=};
position p;
position p != errcode.p;
@@
func(...)
@ -116,21 +131,6 @@ func(...)
...>
}
// Don't generate patches for errcode returns.
@errcode depends on patch@
position p;
identifier func;
expression x;
binary operator cmp = {<, <=};
@@
func(...)
{
<...
return ((x) cmp@p 0 ? (x) : 0);
...>
}
@pmin depends on patch@
identifier func;
expression x, y;