* [PATCH] mtd: nand: denali: set proper error code on timeout
@ 2014-07-22 2:07 Brian Norris
0 siblings, 0 replies; only message in thread
From: Brian Norris @ 2014-07-22 2:07 UTC (permalink / raw)
To: linux-mtd; +Cc: Jamie Iles, Brian Norris
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.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Jamie Iles <jamie@jamieiles.com>
---
drivers/mtd/nand/denali.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index 0b071a3136a2..332a3279dd8d 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -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);
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-22 2:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-22 2:07 [PATCH] mtd: nand: denali: set proper error code on timeout Brian Norris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).