summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHongbo Li <lihongbo22@huawei.com>2024-09-11 09:09:27 +0800
committerJulia Lawall <Julia.Lawall@inria.fr>2024-09-28 21:23:31 +0200
commitf584e3752ca7bb1f8849a85816b3c974f1aa67ec (patch)
tree41a49b4e20e135bff59d35ea3a1ac950433ff9fe /scripts
parent253244cdf16a755039f9078b0a785176712f2584 (diff)
coccinelle: Remove unnecessary parentheses for only one possible change.
The parentheses are only needed if there is a disjunction, ie a set of possible changes. If there is only one pattern, we can remove these parentheses. Just like the format: - x + y not: ( - x + y ) Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coccinelle/api/string_choices.cocci8
1 files changed, 0 insertions, 8 deletions
diff --git a/scripts/coccinelle/api/string_choices.cocci b/scripts/coccinelle/api/string_choices.cocci
index 96dc7090395d..95e9a3b31f86 100644
--- a/scripts/coccinelle/api/string_choices.cocci
+++ b/scripts/coccinelle/api/string_choices.cocci
@@ -43,18 +43,14 @@ coccilib.report.print_report(p[0], "opportunity for str_plural(%s)" % e)
@str_up_down depends on patch@
expression E;
@@
-(
- ((E) ? "up" : "down")
+ str_up_down(E)
-)
@str_up_down_r depends on !patch exists@
expression E;
position P;
@@
-(
* ((E@P) ? "up" : "down")
-)
@script:python depends on report@
p << str_up_down_r.P;
@@ -66,18 +62,14 @@ coccilib.report.print_report(p[0], "opportunity for str_up_down(%s)" % e)
@str_down_up depends on patch@
expression E;
@@
-(
- ((E) ? "down" : "up")
+ str_down_up(E)
-)
@str_down_up_r depends on !patch exists@
expression E;
position P;
@@
-(
* ((E@P) ? "down" : "up")
-)
@script:python depends on report@
p << str_down_up_r.P;