mtd: nand: simplify nand_block_checkbad
if (A) { if (!B) return C; return D; } return C; can be simplified to: if (A && B) return D; return C; Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
2049dbb6fe
commit
c4fa1cb0f6
|
@ -445,10 +445,7 @@ static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int getchip,
|
|||
{
|
||||
struct nand_chip *chip = mtd->priv;
|
||||
|
||||
if (IS_ENABLED(CONFIG_NAND_BBT)) {
|
||||
if (!chip->bbt)
|
||||
return chip->block_bad(mtd, ofs, getchip);
|
||||
|
||||
if (IS_ENABLED(CONFIG_NAND_BBT) && chip->bbt) {
|
||||
/* Return info from the table */
|
||||
return nand_isbad_bbt(mtd, ofs, allowbbt);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue