提交 c115add9 编写于 作者: B Brian Norris

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: NBrian Norris <computersforpeace@gmail.com>
Cc: Jamie Iles <jamie@jamieiles.com>
上级 31f75462
...@@ -1062,9 +1062,7 @@ static int write_page(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -1062,9 +1062,7 @@ static int write_page(struct mtd_info *mtd, struct nand_chip *chip,
dev_err(denali->dev, dev_err(denali->dev,
"timeout on write_page (type = %d)\n", "timeout on write_page (type = %d)\n",
raw_xfer); raw_xfer);
denali->status = denali->status = NAND_STATUS_FAIL;
(irq_status & INTR_STATUS__PROGRAM_FAIL) ?
NAND_STATUS_FAIL : PASS;
} }
denali_enable_dma(denali, false); denali_enable_dma(denali, false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册