aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/scan.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-01-20 03:28:58 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-02-01 08:16:37 -0500
commitadbf05e3ec6ea380ba145b6fa89d9125ed76eb98 (patch)
tree9da867755d3b915ec1a759658397aaa31bc68263 /drivers/mtd/ubi/scan.c
parent0bf1c4399afee6a2031b0ee943a4c016e53f727c (diff)
UBI: simplify debugging return codes
UBI debugging functions were a little bit over-engineered and returned more error codes than needed, and the callers had to do useless checks. Simplify the return codes. Impact: only debugging code is affected, which means that for non-developers this is a no-op patch. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r--drivers/mtd/ubi/scan.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index 90af61a2c3e4..594184bbd56a 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -974,11 +974,8 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi)
974 seb->ec = si->mean_ec; 974 seb->ec = si->mean_ec;
975 975
976 err = paranoid_check_si(ubi, si); 976 err = paranoid_check_si(ubi, si);
977 if (err) { 977 if (err)
978 if (err > 0)
979 err = -EINVAL;
980 goto out_vidh; 978 goto out_vidh;
981 }
982 979
983 ubi_free_vid_hdr(ubi, vidh); 980 ubi_free_vid_hdr(ubi, vidh);
984 kfree(ech); 981 kfree(ech);
@@ -1086,8 +1083,8 @@ void ubi_scan_destroy_si(struct ubi_scan_info *si)
1086 * @ubi: UBI device description object 1083 * @ubi: UBI device description object
1087 * @si: scanning information 1084 * @si: scanning information
1088 * 1085 *
1089 * This function returns zero if the scanning information is all right, %1 if 1086 * This function returns zero if the scanning information is all right, and a
1090 * not and a negative error code if an error occurred. 1087 * negative error code if not or if an error occurred.
1091 */ 1088 */
1092static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si) 1089static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si)
1093{ 1090{
@@ -1346,7 +1343,7 @@ bad_vid_hdr:
1346 1343
1347out: 1344out:
1348 ubi_dbg_dump_stack(); 1345 ubi_dbg_dump_stack();
1349 return 1; 1346 return -EINVAL;
1350} 1347}
1351 1348
1352#endif /* CONFIG_MTD_UBI_DEBUG_PARANOID */ 1349#endif /* CONFIG_MTD_UBI_DEBUG_PARANOID */