In bcm2835_send_cmd the test for a previous command not being complete
depends on cmd not being NULL so a second test in the code block is
redundant as it is guaranteed to be true. Remove the test and the
unreachable code following it.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodb...@linaro.org>
---
 drivers/mmc/bcm2835_sdhost.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mmc/bcm2835_sdhost.c b/drivers/mmc/bcm2835_sdhost.c
index 720127468d3..4ec8c672038 100644
--- a/drivers/mmc/bcm2835_sdhost.c
+++ b/drivers/mmc/bcm2835_sdhost.c
@@ -689,10 +689,7 @@ static int bcm2835_send_cmd(struct udevice *dev, struct 
mmc_cmd *cmd,
                       readl(host->ioaddr + SDCMD) & SDCMD_CMD_MASK, edm);
                bcm2835_dumpregs(host);
 
-               if (cmd)
-                       return -EILSEQ;
-
-               return 0;
+               return -EILSEQ;
        }
 
        if (cmd) {

---
base-commit: 182cb30084516c3085d2ca5dde3f105f7625d774
change-id: 20250729-mmc_bcm2835-c97e9597c25c

Best regards,
-- 
Andrew Goodbody <andrew.goodb...@linaro.org>

Reply via email to