lkml.org 
[lkml]   [2015]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Staging:dgap :Compression of lines for immediate return
From
Date
On Sun, 2015-07-26 at 23:04 +0530, Shraddha Barke wrote:
> This patch compresses two lines into a single line if immediate return statement
> is found. Also,remove variable rc as it is no longer needed.
> It is done using tool Coccinelle. And semantic patch used for this is as follows:
>
> @@
> expression ret;
> identifier f;
> @@
> -ret =
> +return
> f(...);
> -return ret;

This isn't an always safe or side-effect free
semantic patch as there may be a cast lost by
such a conversion.

int foo(void)
{
char i = 0xffffffff;
return i;
}

where i is now int not char



\
 
 \ /
  Last update: 2015-07-26 22:01    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog