Skip to contentSkip to conversation

mtd: nand: denali: set proper error code on timeout

PATCH New Brian Norris 1 participant 1 message Jul 22, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: nand: denali: set proper error code on timeout

The condition "if (irq_status == 0)" already ensures that one half of the ternary ?: is dead. I think this should probably actually be a FAIL, not a PASS.

Caught by Coverity.

---
 drivers/mtd/nand/denali.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/nand/denali.c +1 -3
index 0b071a3136a2..332a3279dd8d 100644
@@ -1061,9 +1061,7 @@ static int write_page(struct mtd_info *mtd, struct nand_chip *chip,
 		dev_err(denali->dev,
 				"timeout on write_page (type = %d)\n",
 				raw_xfer);
-		denali->status =
-			(irq_status & INTR_STATUS__PROGRAM_FAIL) ?
-			NAND_STATUS_FAIL : PASS;
+		denali->status = NAND_STATUS_FAIL;
 	}
 
 	denali_enable_dma(denali, false);
Signature · 1 line
1.9.1