[Cocci] [PATCH v4] coccinelle: api: semantic patch to use pm_runtime_resume_and_get

2021-04-29 Thread Julia Lawall
pm_runtime_get_sync keeps a reference count on failure, which can lead to leaks. pm_runtime_resume_and_get drops the reference count in the failure case. This rule very conservatively follows the definition of pm_runtime_resume_and_get to address the cases where the reference count is unlikely

Re: [Cocci] [PATCH v4] coccinelle: api: semantic patch to use pm_runtime_resume_and_get

2021-04-29 Thread Markus Elfring
… > +msg = "WARNING: opportunity for pm_runtime_get_sync" > +coccilib.org.print_todo(j0[0], msg) … Do you find the following message variant more helpful? +coccilib.org.print_todo(j0[0], +"WARNING: opportunity for replacing pm_runtime_get_sync() by

Re: [Cocci] [PATCH v4] coccinelle: api: semantic patch to use pm_runtime_resume_and_get

2021-04-29 Thread Markus Elfring
>… 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

[Cocci] [PATCH v4] coccinelle: api: semantic patch to use pm_runtime_resume_and_get

2021-04-27 Thread Julia Lawall
pm_runtime_get_sync keeps a reference count on failure, which can lead to leaks. pm_runtime_resume_and_get drops the reference count in the failure case. This rule very conservatively follows the definition of pm_runtime_resume_and_get to address the cases where the reference count is unlikely