>     if match:
>         coccinelle.km = match.group(1)

I suggest to add a bit of code like the following.

    else:
         cocci.include_match(False)


How do you think about to use an other SmPL rule variant?

@addition@
expression context;
identifier find_kmap_tagged_function.fn, parse_kmap_tag.km;
@@
 fn(...)
 {
 <+...
(kmap_atomic
|kunmap_atomic
)(context
+, km
 )
 ...+>
 }


Would the use of an additional position variable influence the run time 
characteristics
in positive ways for this data processing approach?


> This works just fine, except for the case where no "tag" was found.

Would you like to extend corresponding case distinctions any further?


> Ideally, I would like for coccinelle to not touch the function at all if it 
> doesn't
> have a "tag". I'm not sure if this is objectively the best solution, but it 
> seems
> the most logical to me.

Did you check any development possibilities around constraints for 
metavariables?

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to