[PATCH 10/39] mtd: nand: denali: remove redundant if conditional of erased_check

From: Masahiro Yamada
Date: Sat Nov 26 2016 - 13:13:56 EST


This code block is nested by double "if (check_erase_page)".
Remove the redundant inner one.

Signed-off-by: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
---

drivers/mtd/nand/denali.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index 753e9a02..ab59371 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1157,12 +1157,10 @@ static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip,
read_oob_data(mtd, chip->oob_poi, denali->page);

/* check ECC failures that may have occurred on erased pages */
- if (check_erased_page) {
- if (!is_erased(buf, mtd->writesize))
- mtd->ecc_stats.failed++;
- if (!is_erased(chip->oob_poi, mtd->oobsize))
- mtd->ecc_stats.failed++;
- }
+ if (!is_erased(buf, mtd->writesize))
+ mtd->ecc_stats.failed++;
+ if (!is_erased(chip->oob_poi, mtd->oobsize))
+ mtd->ecc_stats.failed++;
}
return max_bitflips;
}
--
2.7.4