diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2014-05-26 16:08:50 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-26 10:32:15 -0700 |
commit | 4764ca981b040048766e4f39a45a4b9c5cecff9c (patch) | |
tree | b4743d812ce65e2be8ca8e9190a0385029bff358 /drivers/staging/silicom/bpctl_mod.c | |
parent | 9c73b46af4f74c255fbc26edebef8b2a61f2b7e4 (diff) | |
download | op-kernel-dev-4764ca981b040048766e4f39a45a4b9c5cecff9c.zip op-kernel-dev-4764ca981b040048766e4f39a45a4b9c5cecff9c.tar.gz |
drivers/staging: Remove useless return variables
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.
Verified by compilation only.
The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
when strict
return
- ret
+ C
;
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/silicom/bpctl_mod.c')
-rw-r--r-- | drivers/staging/silicom/bpctl_mod.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c index 22bf4bf..f74b5e7 100644 --- a/drivers/staging/silicom/bpctl_mod.c +++ b/drivers/staging/silicom/bpctl_mod.c @@ -1564,7 +1564,7 @@ int pulse_set_fn(struct bpctl_dev *pbpctl_dev, unsigned int counter) int zero_set_fn(struct bpctl_dev *pbpctl_dev) { - uint32_t ctrl_ext = 0, ctrl_value = 0; + uint32_t ctrl_ext = 0; if (!pbpctl_dev) return -1; @@ -1585,7 +1585,7 @@ int zero_set_fn(struct bpctl_dev *pbpctl_dev) BPCTLI_CTRL_EXT_MDIO_DATA))); } - return ctrl_value; + return 0; } int pulse_get2_fn(struct bpctl_dev *pbpctl_dev) |