]> git.baikalelectronics.ru Git - kernel.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)
commit20ebb13794315e55131a661c7efc74fb9c9b04f1
treea692666fac149cdef37c68837b2c2573cb330ba7
parentf268be7329634bfa357da3be9638f1622c937310
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