9
0
Fork 0

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:
Uwe Kleine-König 2016-06-20 10:30:17 +02:00 committed by Sascha Hauer
parent 2049dbb6fe
commit c4fa1cb0f6
1 changed files with 1 additions and 4 deletions

View File

@ -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);
}