mmc: gen_atmel_mci: Remove duplicate checks
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 29 Jul 2025 16:16:16 +0000 (17:16 +0100)
committerEugen Hristev <eugen.hristev@linaro.org>
Wed, 13 Aug 2025 09:59:36 +0000 (12:59 +0300)
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>
drivers/mmc/gen_atmel_mci.c

index 6a531fa..62aa6b3 100644 (file)
@@ -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;
 }