From: Artem Bityutskiy <dedekind1@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: Matthieu CASTET <matthieu.castet@parrot.com>,
"Matthew L. Creech" <mlcreech@gmail.com>
Subject: [PATCH 06/13] UBI: rename a local variable
Date: Mon, 6 Sep 2010 11:54:50 +0300 [thread overview]
Message-ID: <1283763293-1882-7-git-send-email-dedekind1@gmail.com> (raw)
In-Reply-To: <1283763293-1882-1-git-send-email-dedekind1@gmail.com>
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Rename local variable 'ec_corr' into 'ec_err' to make the code a little bit
more readable. 'ec_err' is more appropriate because it sounds more like 'error
when EC was read' and it looks more logical because we use it together with
'err'. Just a minor nicification which should improve the rather complex
scanning code.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
drivers/mtd/ubi/scan.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index 6f90807..a15e9bc 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -725,7 +725,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
int pnum)
{
long long uninitialized_var(ec);
- int err, bitflips = 0, vol_id, ec_corr = 0;
+ int err, bitflips = 0, vol_id, ec_err = 0;
dbg_bld("scan PEB %d", pnum);
@@ -756,12 +756,12 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
* corrupted. Set %bitflips flag in order to make this PEB be
* moved and EC be re-created.
*/
- ec_corr = err;
+ ec_err = err;
ec = UBI_SCAN_UNKNOWN_EC;
bitflips = 1;
}
- if (!ec_corr) {
+ if (!ec_err) {
int image_seq;
/* Make sure UBI version is OK */
@@ -817,10 +817,10 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
else if (err == UBI_IO_BITFLIPS)
bitflips = 1;
else if (err == UBI_IO_BAD_HDR_EBADMSG || err == UBI_IO_BAD_HDR ||
- (err == UBI_IO_FF && ec_corr) || err == UBI_IO_FF_BITFLIPS) {
+ (err == UBI_IO_FF && ec_err) || err == UBI_IO_FF_BITFLIPS) {
/* VID header is corrupted */
if (err == UBI_IO_BAD_HDR_EBADMSG ||
- ec_corr == UBI_IO_BAD_HDR_EBADMSG)
+ ec_err == UBI_IO_BAD_HDR_EBADMSG)
si->read_err_count += 1;
err = add_to_list(si, pnum, ec, &si->corr);
if (err)
@@ -870,7 +870,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
}
}
- if (ec_corr)
+ if (ec_err)
ubi_warn("valid VID header but corrupted EC header at PEB %d",
pnum);
err = ubi_scan_add_used(ubi, si, pnum, ec, vidh, bitflips);
@@ -878,7 +878,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
return err;
adjust_mean_ec:
- if (!ec_corr) {
+ if (!ec_err) {
si->ec_sum += ec;
si->ec_count += 1;
if (ec > si->max_ec)
--
1.7.1.1
next prev parent reply other threads:[~2010-09-06 8:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-06 8:54 [PATCH 00/13] UBI reliability improvements Artem Bityutskiy
2010-09-06 8:54 ` [PATCH 01/13] mtd: nand_nase: do not cache pages with uncorrectable ECC errors Artem Bityutskiy
2010-09-06 8:54 ` [PATCH 02/13] UBI: fix small 80 characters limit style issue Artem Bityutskiy
2010-09-06 8:54 ` [PATCH 03/13] UBI: rename IO error code Artem Bityutskiy
2010-09-06 8:54 ` [PATCH 04/13] UBI: remove duplicate IO error codes Artem Bityutskiy
2010-09-06 8:54 ` [PATCH 05/13] UBI: handle bit-flips when no header found Artem Bityutskiy
2010-09-06 8:54 ` Artem Bityutskiy [this message]
2010-09-06 8:54 ` [PATCH 07/13] UBI: change cascade of ifs to switch statements Artem Bityutskiy
2010-09-06 8:54 ` [PATCH 08/13] UBI: separate out corrupted list Artem Bityutskiy
2010-09-06 8:54 ` [PATCH 09/13] UBI: do not put eraseblocks to the corrupted list unnecessarily Artem Bityutskiy
2010-09-13 18:29 ` [PATCH 00/13] UBI reliability improvements Artem Bityutskiy
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=1283763293-1882-7-git-send-email-dedekind1@gmail.com \
--to=dedekind1@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=matthieu.castet@parrot.com \
--cc=mlcreech@gmail.com \
/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).