Re: [cocci] [PATCH] HID: fix semantic patch and improve its performance

From
Markus Elfring <hidden>
Date
2026-08-27 11:51:26
Also in
linux-input, lkml
Reply to
Julia Lawall, 2026-08-27
Replace "expression" with "identifier" in the declaration of hdev.
This is necessary because hdev is used as the name of a function
parameter.
…
quoted hunk ↗ jump to hunk
+++ b/scripts/coccinelle/hid/ff_race.cocci
…
quoted hunk ↗ jump to hunk
-@r@
+@r exists@
 identifier probe_fn;
-expression hdev, flags;
+identifier hdev;
May the following SmPL code variant be applied?

 identifier hdev, probe_fn;

quoted hunk ↗ jump to hunk
+expression flags;
 position p1, p2;
 @@
 
 probe_fn(struct hid_device *hdev, ...) {
-  <...
+  ... when any
   hid_hw_start@p1(hdev, flags)
   ...
-  \(input_ff_create\|input_ff_create_memless\)@p2(...)
-  ...>
+  \(input_ff_create@p2\|input_ff_create_memless@p2\)(...)
How do you think about to use the following SmPL code variation?

(input_ff_create@p2
|input_ff_create_memless@p2
)(...)

quoted hunk ↗ jump to hunk
+  ... when any
 }
 
 @script:python depends on report@
Regards,
Markus
Thread (5 messages) 5 messages, 3 authors, last reply 2026-09-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help