]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mtd: rawnand: denali: Remove always true test
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Fri, 1 Aug 2025 09:54:05 +0000 (10:54 +0100)
committerMichael Trimarchi <michael@amarulasolutions.com>
Sun, 3 Aug 2025 08:22:04 +0000 (10:22 +0200)
In denali_wait_for_irq the code will either return from inside the while
loop or exit with time_left being 0. The following test for time_left
being 0 is guranteed to be true so remove the test and the following
unreachable code.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
drivers/mtd/nand/raw/denali.c

index b2401116689a690e4658c9e3f06f8089f0bc0ae1..39cb641e0b3d93e9e7035b805e33e2607bdb3778 100644 (file)
@@ -173,13 +173,9 @@ static uint32_t denali_wait_for_irq(struct denali_nand_info *denali,
                time_left--;
        }
 
-       if (!time_left) {
-               dev_err(denali->dev, "timeout while waiting for irq 0x%x\n",
-                       irq_mask);
-               return 0;
-       }
-
-       return denali->irq_status;
+       dev_err(denali->dev, "timeout while waiting for irq 0x%x\n",
+               irq_mask);
+       return 0;
 }
 
 static uint32_t denali_check_irq(struct denali_nand_info *denali)