1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
systemd/coccinelle/flags-set.cocci
Frantisek Sumsal ccd52940d0 coccinelle: further restrict certain transformations
Some transformations generate results we don't want to keep, so
let's disable such transformations for specific files.

Also, disable const-strlen.cocci everywhere, as the STRLEN macro has a
pretty limited scope, so the transformation generates false positives in
most cases.
2019-04-30 09:39:13 +02:00

17 lines
334 B
Plaintext

@@
/* Disable this transformation for the securebits-util.h, as it makes
* the expression there confusing. */
position p : script:python() { p[0].file != "src/shared/securebits-util.h" };
expression x, y;
@@
(
- ((x@p) & (y)) == (y)
+ FLAGS_SET(x, y)
|
- (x@p & (y)) == (y)
+ FLAGS_SET(x, y)
|
- ((x@p) & y) == y
+ FLAGS_SET(x, y)
)