]> www.infradead.org Git - users/hch/block.git/commit
Reduce Coccinelle choices in string_choices.cocci
authorJulia Lawall <Julia.Lawall@inria.fr>
Sat, 28 Sep 2024 19:26:22 +0000 (21:26 +0200)
committerJulia Lawall <Julia.Lawall@inria.fr>
Sat, 28 Sep 2024 19:33:11 +0000 (21:33 +0200)
commit4003ba664bd16f5a969cc883295a9eb5a5aef19e
tree9a45d467b1ae08b734f93285701e462065adc320
parentf584e3752ca7bb1f8849a85816b3c974f1aa67ec
Reduce Coccinelle choices in string_choices.cocci

The isomorphism neg_if_exp negates the test of a ?: conditional,
making it unnecessary to have an explicit case for a negated test
with the branches inverted.

At the same time, we can disable neg_if_exp in cases where a
different API function may be more suitable for a negated test.

Finally, in the non-patch cases, E matches an expression with
parentheses around it, so there is no need to mention ()
explicitly in the pattern.  The () are still needed in the patch
cases, because we want to drop them, if they are present.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
scripts/coccinelle/api/string_choices.cocci