]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/net/qlcnic: Use available error codes
authorJulia Lawall <julia@diku.dk>
Mon, 16 Aug 2010 10:23:51 +0000 (10:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Aug 2010 21:26:32 +0000 (14:26 -0700)
commitd1ec70fe1570cc8a63b33d2fdf7059f620742e1d
tree9152ef81c79caef6434f077db7b3bf5794e45f96
parent7a0e4cce47d39c705215a65709a3a23d4dcd3f40
drivers/net/qlcnic: Use available error codes

The error code is stored in the variable err, but it is the variable ret
that is returned instead.  So store the error code in ret.  Err is then
useless.

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: David S. Miller <davem@davemloft.net>
drivers/net/qlcnic/qlcnic_main.c