OSDN Git Service

mtd: nand: denali: set proper error code on timeout
authorBrian Norris <computersforpeace@gmail.com>
Tue, 22 Jul 2014 02:07:31 +0000 (19:07 -0700)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 19 Aug 2014 18:53:08 +0000 (11:53 -0700)
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

index da0fcc2..4885a0f 100644 (file)
@@ -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);