diff mbox

[09/10] mmc: block: return 0 where evident

Message ID 20170201124800.13865-10-linus.walleij@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Linus Walleij Feb. 1, 2017, 12:47 p.m. UTC
mmc_sd_num_wr_blocks() has this construction:

if (err)
    return err;
if (some_other_stuff_not_touching_err)
    return err;

It follows from logical deduction that we can just return 0
in the latter case.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/core/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 92f7772ca56d..c49c90dba839 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -788,7 +788,7 @@  static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks)
 	if (err)
 		return err;
 	if (!mmc_host_is_spi(card->host) && !(cmd.resp[0] & R1_APP_CMD))
-		return err;
+		return 0;
 
 	memset(&cmd, 0, sizeof(struct mmc_command));