From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>, linux-mtd@lists.infradead.org
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Dimitri Gorokhovik <dimitri.gorokhovik@free.fr>
Subject: [PATCH] mtd: ntfl: reorganize operations in condition check
Date: Tue, 6 Jan 2015 23:33:34 +0200 [thread overview]
Message-ID: <1420580014-25215-1-git-send-email-andy.shevchenko@gmail.com> (raw)
We need to compare ret variable for negative value. The current code
assigns the boolean to the ret and prints it wrongly in the warning
message.
Cc: Dimitri Gorokhovik <dimitri.gorokhovik@free.fr>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
drivers/mtd/nftlmount.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nftlmount.c b/drivers/mtd/nftlmount.c
index 51b9d6a..557dfa2 100644
--- a/drivers/mtd/nftlmount.c
+++ b/drivers/mtd/nftlmount.c
@@ -89,9 +89,10 @@ static int find_boot_record(struct NFTLrecord *nftl)
}
/* To be safer with BIOS, also use erase mark as discriminant */
- if ((ret = nftl_read_oob(mtd, block * nftl->EraseSize +
+ ret = nftl_read_oob(mtd, block * nftl->EraseSize +
SECTORSIZE + 8, 8, &retlen,
- (char *)&h1) < 0)) {
+ (char *)&h1);
+ if (ret < 0) {
printk(KERN_WARNING "ANAND header found at 0x%x in mtd%d, but OOB data read failed (err %d)\n",
block * nftl->EraseSize, nftl->mbd.mtd->index, ret);
continue;
--
1.8.3.101.g727a46b
reply other threads:[~2015-01-06 21:34 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=1420580014-25215-1-git-send-email-andy.shevchenko@gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=dimitri.gorokhovik@free.fr \
--cc=dwmw2@infradead.org \
--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).