diff options
author | Namrata A Shettar <namrataashettar@gmail.com> | 2016-09-30 19:14:54 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-02 17:19:51 +0200 |
commit | 8244d269098348f9bcfbcfed5c443857b4c8ffc7 (patch) | |
tree | 38ea65b2f29f0dbb13b9576b30a4ba0eef539d31 /drivers/staging | |
parent | 0ca8df12e78f3085224faac9058a2d278992dd82 (diff) | |
download | linux-stable-8244d269098348f9bcfbcfed5c443857b4c8ffc7.tar.gz linux-stable-8244d269098348f9bcfbcfed5c443857b4c8ffc7.tar.bz2 linux-stable-8244d269098348f9bcfbcfed5c443857b4c8ffc7.zip |
staging: wilc1000: wilc_spi: Compress return logic
Compress return logic. Done using Coccinelle :
@@
local idexpression ret;
expression e;
@@
-ret=
+return
e;
-return ret;
Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/wilc1000/wilc_spi.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index f6c47cab23b9..d865fb1dde1f 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -419,8 +419,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz, if (wilc_spi_tx_rx(wilc, wb, rb, len2)) { dev_err(&spi->dev, "Failed cmd write, bus error...\n"); - result = N_FAIL; - return result; + return N_FAIL; } /** @@ -441,8 +440,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz, dev_err(&spi->dev, "Failed cmd response, cmd (%02x), resp (%02x)\n", cmd, rsp); - result = N_FAIL; - return result; + return N_FAIL; } /** @@ -452,8 +450,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz, if (rsp != 0x00) { dev_err(&spi->dev, "Failed cmd state response state (%02x)\n", rsp); - result = N_FAIL; - return result; + return N_FAIL; } if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ) @@ -480,8 +477,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz, if (retry <= 0) { dev_err(&spi->dev, "Error, data read response (%02x)\n", rsp); - result = N_RESET; - return result; + return N_RESET; } if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ)) { @@ -496,8 +492,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz, } else { dev_err(&spi->dev, "buffer overrun when reading data.\n"); - result = N_FAIL; - return result; + return N_FAIL; } if (!g_spi.crc_off) { @@ -509,8 +504,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz, crc[1] = rb[rix++]; } else { dev_err(&spi->dev, "buffer overrun when reading crc.\n"); - result = N_FAIL; - return result; + return N_FAIL; } } } else if ((cmd == CMD_DMA_READ) || (cmd == CMD_DMA_EXT_READ)) { |