staging: Use available error codes
commit4d9db977f9ac9b15f916888978026025c6cf9563
authorJulia Lawall <julia@diku.dk>
Mon, 16 Aug 2010 16:26:36 +0000 (16 18:26 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 31 Aug 2010 22:05:12 +0000 (31 15:05 -0700)
treec200321e405a3a4a26bcd0d3e8c1f88b71329438
parentbb59a4c539140592723e806e852ee171da0eb3eb
staging: Use available error codes

An error code is stored in a variable, but 0 is returned instead.  Use the
variable instead of 0.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
local idexpression x;
constant C;
@@

if (...) { ...
  x = -C
  ... when != x
(
  return <+...x...+>;
|
  return NULL;
|
  return;
|
* return ...;
)
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/lirc/lirc_sasem.c
drivers/staging/vt6655/iwctl.c
drivers/staging/vt6656/iwctl.c