From: Brian Norris <computersforpeace@gmail.com>
To: <linux-mtd@lists.infradead.org>
Cc: Jamie Iles <jamie@jamieiles.com>,
Brian Norris <computersforpeace@gmail.com>
Subject: [PATCH] mtd: nand: denali: set proper error code on timeout
Date: Mon, 21 Jul 2014 19:07:31 -0700 [thread overview]
Message-ID: <1405994851-19493-1-git-send-email-computersforpeace@gmail.com> (raw)
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
reply other threads:[~2014-07-22 2:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1405994851-19493-1-git-send-email-computersforpeace@gmail.com \
--to=computersforpeace@gmail.com \
--cc=jamie@jamieiles.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).