>… keeps a reference count on failure, … Would you get into the mood to perform a systematic source code search for similar function implementations according to resource clean-up?
> v2: better keyword How do you think about to add the information “wrapper functions” here? … > +@r0 depends on patch && !context && !org && !report@ > +expression ret,e; > +@@ > + > +- ret = pm_runtime_get_sync(e); > ++ ret = pm_runtime_resume_and_get(e); … I suggest once more to concentrate the specification of such a change to the desired replacement of the mentioned function name. + ret = +- pm_runtime_get_sync ++ pm_runtime_resume_and_get + (e); … > + if (ret < 0) > +- { > +- pm_runtime_put_noidle(e); > + S1 > +- } > + else S2 … I propose to put this adjustment into a disjunction for the semantic patch language. How do you think about to combine five SmPL rules into one? … > +* ret@j0 = pm_runtime_get_sync(e); > + if (ret < 0) { > + f(...,c,...); > +* pm_runtime_put_noidle@j1(e); > + ... > + } else S … Would you like to express in the SmPL context rules that a macro or function call is optional here? Are there any opportunities to consider for the avoidance of duplicate SmPL code? … > +msg = "WARNING: opportunity for pm_runtime_get_sync" > +coccilib.org.print_todo(j0[0], msg) … Can the following Python code be more appropriate? +coccilib.org.print_todo(j0[0], "WARNING: opportunity for pm_runtime_resume_and_get") Would you like to reconsider the message also for the SmPL report rule accordingly? Regards, Markus _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci