]> git.karo-electronics.de Git - linux-beck.git/commit
staging: media: davinci_vpfe: remove ret variable in switch statements
authorThaissa Falbo <thaissa.falbo@gmail.com>
Thu, 18 Feb 2016 21:17:54 +0000 (19:17 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 22:56:47 +0000 (14:56 -0800)
commitc3397c1b06b6534caaaffa39160ffe09d540a575
treea692666fac149cdef37c68837b2c2573cb330ba7
parentafa5d19a2b5fbf0bbcce34f3613bce2bc9479bb7
staging: media: davinci_vpfe: remove ret variable in switch statements

Remove ret variable in functions that used it to determine the return.
Simplified the return logic for these functions.

Found with Coccinelle script:

@@
local idexpression ret;
expression c,d;
identifier label;
@@

switch ( ... ) {
case label :
...
- ret = c;
- break;
+ return c;
...
default:
...
- ret = d;
+ return d;
...
}
... when != ret
- return ret;

@@
type T; identifier i;
@@
- T i;
... when != i

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/davinci_vpfe/dm365_ipipe.c
drivers/staging/media/davinci_vpfe/dm365_isif.c