diff options
author | Andrew Goodbody <andrew.goodbody@linaro.org> | 2025-07-29 17:16:16 +0100 |
---|---|---|
committer | Eugen Hristev <eugen.hristev@linaro.org> | 2025-08-13 12:59:36 +0300 |
commit | 4fb189a58eacd8bac267f2f330b41e7700bcfa12 (patch) | |
tree | d1e3f203201f5118fb372ea35bb13f3aa7f9c698 | |
parent | b824136ab4f743e09c81af531d430dbe6a2d92bf (diff) |
mmc: gen_atmel_mci: Remove duplicate checks
Remove duplicate checks on status from mci_data_read and mci_data_write
which are guaranteed to be true as exiting the above do..while loop
above requires that to be so.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r-- | drivers/mmc/gen_atmel_mci.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c index 6a531fa0961..62aa6b3cb0b 100644 --- a/drivers/mmc/gen_atmel_mci.c +++ b/drivers/mmc/gen_atmel_mci.c @@ -206,10 +206,9 @@ static u32 mci_data_read(atmel_mci_t *mci, u32* data, u32 error_flags) goto io_fail; } while (!(status & MMCI_BIT(RXRDY))); - if (status & MMCI_BIT(RXRDY)) { - *data = readl(&mci->rdr); - status = 0; - } + *data = readl(&mci->rdr); + status = 0; + io_fail: return status; } @@ -225,10 +224,9 @@ static u32 mci_data_write(atmel_mci_t *mci, u32* data, u32 error_flags) goto io_fail; } while (!(status & MMCI_BIT(TXRDY))); - if (status & MMCI_BIT(TXRDY)) { - writel(*data, &mci->tdr); - status = 0; - } + writel(*data, &mci->tdr); + status = 0; + io_fail: return status; } |