lkml.org 
[lkml]   [2019]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Coccinelle: Add a SmPL script for the reconsideration of redundant dev_err() calls


On Fri, 21 Jun 2019, Markus Elfring wrote:

> > I think that something like
> >
> > if (IS_ERR(e))
> > {
> > <+...
> > *dev_err(...)
> > ...+>
> > }
> >
> > would be more appropriate. Whether there is a return or not doesn't
> > really matter.
>
> Do you find the following SmPL change specification useful and acceptable?
>
>
> @deletion depends on patch@
> expression e;
> @@
> e = devm_ioremap_resource(...);
> if (IS_ERR(e))
> (
> -{
> - dev_err(...);
> return (...);

I still don't see the point of specifying return. Why not just S, where S
is a statement metavariable?

julia

> -}
> |{

I realize that you confuse conciseness with readability, but it would
really look better to have the | on a line by itself.

julia

> <+...
> - dev_err(...);
> ...+>
> }
> )
>
>
> Would this approach need a version check for the Coccinelle software?

Why would that be necessary?

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