summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSang-Heon Jeon <ekffu200098@gmail.com>2026-08-09 13:53:34 +0900
committerJulia Lawall <Julia.Lawall@inria.fr>2026-08-23 22:12:10 +0200
commit707f8e0ddf3f730c15e5c18b346d4258ddb46868 (patch)
tree60dde58a6f1604041d9af5dca0414d8e985af6ab /scripts
parenta53cbd149844cbde80f6adfc7f4233b8f230f664 (diff)
downloadlinux-707f8e0ddf3f730c15e5c18b346d4258ddb46868.tar.gz
linux-707f8e0ddf3f730c15e5c18b346d4258ddb46868.zip
coccinelle: misc: struct_size: drop unneeded parentheses
The outer parentheses and the single-branch disjunction don't matter when just matching and reporting a line. Eliminating them reduces the complexity of the pattern to match and gives a performance improvement in the non-patch cases, like the previous minmax change. Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coccinelle/misc/struct_size.cocci8
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/coccinelle/misc/struct_size.cocci b/scripts/coccinelle/misc/struct_size.cocci
index 9b02c37438e4..406884d68d43 100644
--- a/scripts/coccinelle/misc/struct_size.cocci
+++ b/scripts/coccinelle/misc/struct_size.cocci
@@ -29,9 +29,7 @@ f
expression E1, E2;
identifier m;
@@
-(
-* (sizeof(*E1) + (E2 * sizeof(*E1->m)))
-)
+* sizeof(*E1) + (E2 * sizeof(*E1->m))
//----------------------------------------------------------
// For patch mode
@@ -55,9 +53,7 @@ expression E1, E2;
identifier m;
position p;
@@
-(
- (sizeof(*E1)@p + (E2 * sizeof(*E1->m)))
-)
+ sizeof(*E1)@p + (E2 * sizeof(*E1->m))
@script:python depends on org@
p << r.p;