Staging:dgap :Compression of lines for immediate return
authorShraddha Barke <shraddha.6596@gmail.com>
Mon, 27 Jul 2015 18:00:52 +0000 (23:30 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Jul 2015 23:14:53 +0000 (16:14 -0700)
commit6ba4df24bb87246472be90b11fcecb720c2a15ba
tree3082b2ed8aa258743af28da232713123eb2f3ffa
parentbd1ccd33150261f0e58be6de615e4b14389ac208
Staging:dgap :Compression of lines for immediate return

This patch compresses two lines into a single line
if immediate return statement is found. Remove variable rc as
it is no longer needed.

It is done using script Coccinelle. And coccinelle uses the following
semantic patch for this compression function:

@@
type T;
identifier i,f;
constant C;
@@
- T i;
  ...when != i
     when strict
(
  return -C;
|
- i =
+ return
     f(...);
- return i;
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap.c