lkml.org 
[lkml]   [2019]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Coccinelle: Add a SmPL script for the reconsideration of redundant dev_err() calls
From
Date
>> +@display depends on context@
>> +expression e;
>> +@@
>> + e = devm_ioremap_resource(...);
>> + if (IS_ERR(e))
>> + {
>> +* dev_err(...);
>> + return (...);
>> + }
>
> Why do you assume that there is exactly one dev_err and one return after
> the test?

I propose to start with the addition of a simple source code search pattern.
Would you prefer to clarify a more advanced approach?


>> +@script:python to_do depends on org@
>> +p << or.p;
>> +@@
>> +coccilib.org.print_todo(p[0],
>> + "WARNING: An error message is probably not needed here because the previously called function contains appropriate error reporting.")
>
> "the previously called function" would be better as "devm_ioremap_resource".

Would you like to get the relevant function name dynamically determined?

Regards,
Markus

\
 
 \ /
  Last update: 2019-06-20 21:04    [W:0.097 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site