mtd: spi-nor: remove redundant continue statement
authorColin Ian King <colin.king@canonical.com>
Fri, 18 Jun 2021 09:33:31 +0000 (10:33 +0100)
committerVignesh Raghavendra <vigneshr@ti.com>
Mon, 21 Jun 2021 05:47:10 +0000 (11:17 +0530)
The continue statement at the end of a for-loop has no effect,
invert the if expression and remove the continue.

Addresses-Coverity: ("Continue has no effect")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
drivers/mtd/spi-nor/core.c

index 970ed6e..cc08bd7 100644 (file)
@@ -1411,9 +1411,7 @@ spi_nor_find_best_erase_type(const struct spi_nor_erase_map *map,
                        continue;
 
                spi_nor_div_by_erase_size(erase, addr, &rem);
-               if (rem)
-                       continue;
-               else
+               if (!rem)
                        return erase;
        }