* [PATCH] mmc: sdricoh_cs: remove redundant check if len is non-zero
@ 2017-05-09 15:45 Colin King
2017-05-15 10:51 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-05-09 15:45 UTC (permalink / raw)
To: Sascha Sommer, Ulf Hansson, linux-mmc; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
At the end of either of the read or write loops len is always zero
and hence the non-zero check on len and return of -EIO is redundant
and can be removed.
Detected by CoverityScan, CID#114293 ("Logically dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/mmc/host/sdricoh_cs.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/mmc/host/sdricoh_cs.c b/drivers/mmc/host/sdricoh_cs.c
index 5ff26ab81eb1..70cb00aa79a0 100644
--- a/drivers/mmc/host/sdricoh_cs.c
+++ b/drivers/mmc/host/sdricoh_cs.c
@@ -256,9 +256,6 @@ static int sdricoh_blockio(struct sdricoh_host *host, int read,
}
}
- if (len)
- return -EIO;
-
return 0;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc: sdricoh_cs: remove redundant check if len is non-zero
2017-05-09 15:45 [PATCH] mmc: sdricoh_cs: remove redundant check if len is non-zero Colin King
@ 2017-05-15 10:51 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2017-05-15 10:51 UTC (permalink / raw)
To: Colin King; +Cc: Sascha Sommer, linux-mmc, kernel-janitors, linux-kernel
On 9 May 2017 at 17:45, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> At the end of either of the read or write loops len is always zero
> and hence the non-zero check on len and return of -EIO is redundant
> and can be removed.
>
> Detected by CoverityScan, CID#114293 ("Logically dead code")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Thanks, applied for next!
Kind regards
Uffe
> ---
> drivers/mmc/host/sdricoh_cs.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdricoh_cs.c b/drivers/mmc/host/sdricoh_cs.c
> index 5ff26ab81eb1..70cb00aa79a0 100644
> --- a/drivers/mmc/host/sdricoh_cs.c
> +++ b/drivers/mmc/host/sdricoh_cs.c
> @@ -256,9 +256,6 @@ static int sdricoh_blockio(struct sdricoh_host *host, int read,
> }
> }
>
> - if (len)
> - return -EIO;
> -
> return 0;
> }
>
> --
> 2.11.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-15 10:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 15:45 [PATCH] mmc: sdricoh_cs: remove redundant check if len is non-zero Colin King
2017-05-15 10:51 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).