在 2022/9/21 4:13, Julia Lawall 写道:
+mutex_init(\(&mm->fld\|&(mm->fld)\))
An extra SmPL disjunction is probably unnecessary because of an isomorphism.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/3f7496ff9c2c5d4fadae1e585aa458e1a0037972/standard.iso#L382
https://github.com/coccinelle/coccinelle/blob/19ee1697bf152d37a78a20cefe148775bf4b0e0d/standard.iso#L382
This is correct. It would be better to only have the version with the
parentheses, because Coccinelle will consider the case without parentheses
anyway.
I see, I will former one in the next version.
+mutex_init(&(mm->fld))
…
+@r3@
+identifier s, fld;
+position p != {r2.p};
Why do you think that such a SmPL constraint would be required?
+@@
+
+struct s {
+ ...
+ struct mutex fld@p;
+ ...
+};
Why would the source code search repetition matter here?
He is searching for a structure that is different from the ones matched
previously.
…
+@r5 depends on r4@
+identifier r3.s;
+struct s *mm;
+position p;
+@@
+* mm@p = \(kmalloc\|kzalloc\|devm_kmalloc\|devm_kzalloc\)(...)
I would expect that the usage of the asterisk in the first column should belong
to the operation mode “context”.
This is correct. Either the context mode should be fully supported or the
asterisk should be removed.
Ok, I do not mean to support context mode, the asterisk will be remove
in the next version.
Thanks for your reply.
Best regards,
Yuan Can