diff options
author | Rehas Sachdeva <aquannie@gmail.com> | 2016-09-20 03:48:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-20 07:32:28 -0400 |
commit | d37843d1a956bf87e219067a0f45bc82db260216 (patch) | |
tree | e82ed0097af64c910a7b6c393302bd8ccc048d17 /drivers/staging | |
parent | 51319662d6ac5729a1950579d70808d94e4fa8e6 (diff) |
staging: wilc1000: Merge assignment with return
Instead of storing the return value into a variable and then returning it, we
can club the two into a single return statement. This change was made using
the following semantic patch by Coccinelle:
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/wilc1000/host_interface.c | 5 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_spi.c | 3 | ||||
-rw-r--r-- | drivers/staging/wilc1000/wilc_wlan.c | 3 |
3 files changed, 3 insertions, 8 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index d0cb568c94b1..78f5613e9467 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c | |||
@@ -3279,7 +3279,6 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, | |||
3279 | int wilc_hif_set_cfg(struct wilc_vif *vif, | 3279 | int wilc_hif_set_cfg(struct wilc_vif *vif, |
3280 | struct cfg_param_attr *cfg_param) | 3280 | struct cfg_param_attr *cfg_param) |
3281 | { | 3281 | { |
3282 | int result = 0; | ||
3283 | struct host_if_msg msg; | 3282 | struct host_if_msg msg; |
3284 | struct host_if_drv *hif_drv = vif->hif_drv; | 3283 | struct host_if_drv *hif_drv = vif->hif_drv; |
3285 | 3284 | ||
@@ -3293,9 +3292,7 @@ int wilc_hif_set_cfg(struct wilc_vif *vif, | |||
3293 | msg.body.cfg_info = *cfg_param; | 3292 | msg.body.cfg_info = *cfg_param; |
3294 | msg.vif = vif; | 3293 | msg.vif = vif; |
3295 | 3294 | ||
3296 | result = wilc_enqueue_cmd(&msg); | 3295 | return wilc_enqueue_cmd(&msg); |
3297 | |||
3298 | return result; | ||
3299 | } | 3296 | } |
3300 | 3297 | ||
3301 | static void GetPeriodicRSSI(unsigned long arg) | 3298 | static void GetPeriodicRSSI(unsigned long arg) |
diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index 0f8d62594bee..f6c47cab23b9 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c | |||
@@ -410,8 +410,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz, | |||
410 | if (len2 > ARRAY_SIZE(wb)) { | 410 | if (len2 > ARRAY_SIZE(wb)) { |
411 | dev_err(&spi->dev, "spi buffer size too small (%d) (%zu)\n", | 411 | dev_err(&spi->dev, "spi buffer size too small (%d) (%zu)\n", |
412 | len2, ARRAY_SIZE(wb)); | 412 | len2, ARRAY_SIZE(wb)); |
413 | result = N_FAIL; | 413 | return N_FAIL; |
414 | return result; | ||
415 | } | 414 | } |
416 | /* zero spi write buffers. */ | 415 | /* zero spi write buffers. */ |
417 | for (wix = len; wix < len2; wix++) | 416 | for (wix = len; wix < len2; wix++) |
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 19a580939dfc..2b307ce0a9bb 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c | |||
@@ -1001,8 +1001,7 @@ int wilc_wlan_start(struct wilc *wilc) | |||
1001 | ret = wilc->hif_func->hif_write_reg(wilc, WILC_VMM_CORE_CFG, reg); | 1001 | ret = wilc->hif_func->hif_write_reg(wilc, WILC_VMM_CORE_CFG, reg); |
1002 | if (!ret) { | 1002 | if (!ret) { |
1003 | release_bus(wilc, RELEASE_ONLY); | 1003 | release_bus(wilc, RELEASE_ONLY); |
1004 | ret = -EIO; | 1004 | return -EIO; |
1005 | return ret; | ||
1006 | } | 1005 | } |
1007 | reg = 0; | 1006 | reg = 0; |
1008 | if (wilc->io_type == HIF_SDIO && wilc->dev_irq_num) | 1007 | if (wilc->io_type == HIF_SDIO && wilc->dev_irq_num) |