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

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Oct 15 23:59:03 PDT 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=c115add9d073752d38f6517882dfeafe76fc4458
Commit:     c115add9d073752d38f6517882dfeafe76fc4458
Parent:     31f754628cbb12c983600f22d9f0fed50dfe2134
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Mon Jul 21 19:07:31 2014 -0700
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Tue Aug 19 11:53:08 2014 -0700

    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.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Cc: Jamie Iles <jamie at 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 da0fcc2..4885a0f 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1062,9 +1062,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);



More information about the linux-mtd-cvs mailing list