diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-09-03 07:53:23 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-10-19 10:19:56 -0400 |
commit | e0e718c281ce1dd4006681e1255535cc6f2857d4 (patch) | |
tree | 14958b8e11ffd676360f8709501924ff0963b7ae | |
parent | 92e1a7d9e7e07fb1cf0cbbcdf202938d0819b54d (diff) |
UBI: rename a local variable
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>
-rw-r--r-- | 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 6f9080767e3f..a15e9bcb6e77 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, | |||
725 | int pnum) | 725 | int pnum) |
726 | { | 726 | { |
727 | long long uninitialized_var(ec); | 727 | long long uninitialized_var(ec); |
728 | int err, bitflips = 0, vol_id, ec_corr = 0; | 728 | int err, bitflips = 0, vol_id, ec_err = 0; |
729 | 729 | ||
730 | dbg_bld("scan PEB %d", pnum); | 730 | dbg_bld("scan PEB %d", pnum); |
731 | 731 | ||
@@ -756,12 +756,12 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
756 | * corrupted. Set %bitflips flag in order to make this PEB be | 756 | * corrupted. Set %bitflips flag in order to make this PEB be |
757 | * moved and EC be re-created. | 757 | * moved and EC be re-created. |
758 | */ | 758 | */ |
759 | ec_corr = err; | 759 | ec_err = err; |
760 | ec = UBI_SCAN_UNKNOWN_EC; | 760 | ec = UBI_SCAN_UNKNOWN_EC; |
761 | bitflips = 1; | 761 | bitflips = 1; |
762 | } | 762 | } |
763 | 763 | ||
764 | if (!ec_corr) { | 764 | if (!ec_err) { |
765 | int image_seq; | 765 | int image_seq; |
766 | 766 | ||
767 | /* Make sure UBI version is OK */ | 767 | /* Make sure UBI version is OK */ |
@@ -817,10 +817,10 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
817 | else if (err == UBI_IO_BITFLIPS) | 817 | else if (err == UBI_IO_BITFLIPS) |
818 | bitflips = 1; | 818 | bitflips = 1; |
819 | else if (err == UBI_IO_BAD_HDR_EBADMSG || err == UBI_IO_BAD_HDR || | 819 | else if (err == UBI_IO_BAD_HDR_EBADMSG || err == UBI_IO_BAD_HDR || |
820 | (err == UBI_IO_FF && ec_corr) || err == UBI_IO_FF_BITFLIPS) { | 820 | (err == UBI_IO_FF && ec_err) || err == UBI_IO_FF_BITFLIPS) { |
821 | /* VID header is corrupted */ | 821 | /* VID header is corrupted */ |
822 | if (err == UBI_IO_BAD_HDR_EBADMSG || | 822 | if (err == UBI_IO_BAD_HDR_EBADMSG || |
823 | ec_corr == UBI_IO_BAD_HDR_EBADMSG) | 823 | ec_err == UBI_IO_BAD_HDR_EBADMSG) |
824 | si->read_err_count += 1; | 824 | si->read_err_count += 1; |
825 | err = add_to_list(si, pnum, ec, &si->corr); | 825 | err = add_to_list(si, pnum, ec, &si->corr); |
826 | if (err) | 826 | if (err) |
@@ -870,7 +870,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
870 | } | 870 | } |
871 | } | 871 | } |
872 | 872 | ||
873 | if (ec_corr) | 873 | if (ec_err) |
874 | ubi_warn("valid VID header but corrupted EC header at PEB %d", | 874 | ubi_warn("valid VID header but corrupted EC header at PEB %d", |
875 | pnum); | 875 | pnum); |
876 | err = ubi_scan_add_used(ubi, si, pnum, ec, vidh, bitflips); | 876 | 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, | |||
878 | return err; | 878 | return err; |
879 | 879 | ||
880 | adjust_mean_ec: | 880 | adjust_mean_ec: |
881 | if (!ec_corr) { | 881 | if (!ec_err) { |
882 | si->ec_sum += ec; | 882 | si->ec_sum += ec; |
883 | si->ec_count += 1; | 883 | si->ec_count += 1; |
884 | if (ec > si->max_ec) | 884 | if (ec > si->max_ec) |