Skip to content

Commit

Permalink
staging: Use available error codes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed Aug 31, 2010
1 parent bb59a4c commit 4d9db97
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/lirc/lirc_sasem.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static int ir_open(void *data)
mutex_unlock(&context->ctx_lock);

mutex_unlock(&disconnect_lock);
return 0;
return retval;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/vt6655/iwctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1900,7 +1900,7 @@ int iwctl_siwgenie(struct net_device *dev,
}

out://not completely ...not necessary in wpa_supplicant 0.5.8
return 0;
return ret;
}

int iwctl_giwgenie(struct net_device *dev,
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/vt6656/iwctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ int iwctl_siwgenie(struct net_device *dev,
}

out://not completely ...not necessary in wpa_supplicant 0.5.8
return 0;
return ret;
}

int iwctl_giwgenie(struct net_device *dev,
Expand Down

0 comments on commit 4d9db97

Please sign in to comment.