Thread (4 messages) 4 messages, 2 authors, 6d ago

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

From: Julia Lawall <julia.lawall@inria.fr>
Date: 2026-08-27 12:00:08
Also in: cocci, linux-doc, lkml


On Thu, 27 Aug 2026, Markus Elfring wrote:
quoted
Replace "expression" with "identifier" in the declaration of hdev.
This is necessary because hdev is used as the name of a function
parameter.
quoted
+++ b/scripts/coccinelle/hid/ff_race.cocci
quoted
-@r@
+@r exists@
 identifier probe_fn;
-expression hdev, flags;
+identifier hdev;
May the following SmPL code variant be applied?

 identifier hdev, probe_fn;
Yes, but it doesn't matter.
quoted
+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
)(...)
I find this completely unreadable.

julia
quoted
+  ... when any
 }

 @script:python depends on report@
Regards,
Markus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help