aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r--drivers/mtd/ubi/scan.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index 1c1401d6958b..44d87e8158c6 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -45,8 +45,7 @@
45#include "ubi.h" 45#include "ubi.h"
46 46
47#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID 47#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
48static int paranoid_check_si(const struct ubi_device *ubi, 48static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si);
49 struct ubi_scan_info *si);
50#else 49#else
51#define paranoid_check_si(ubi, si) 0 50#define paranoid_check_si(ubi, si) 0
52#endif 51#endif
@@ -259,9 +258,8 @@ static struct ubi_scan_volume *add_volume(struct ubi_scan_info *si, int vol_id,
259 * o bit 2 is cleared: the older LEB is not corrupted; 258 * o bit 2 is cleared: the older LEB is not corrupted;
260 * o bit 2 is set: the older LEB is corrupted. 259 * o bit 2 is set: the older LEB is corrupted.
261 */ 260 */
262static int compare_lebs(const struct ubi_device *ubi, 261static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
263 const struct ubi_scan_leb *seb, int pnum, 262 int pnum, const struct ubi_vid_hdr *vid_hdr)
264 const struct ubi_vid_hdr *vid_hdr)
265{ 263{
266 void *buf; 264 void *buf;
267 int len, err, second_is_newer, bitflips = 0, corrupted = 0; 265 int len, err, second_is_newer, bitflips = 0, corrupted = 0;
@@ -413,7 +411,7 @@ out_free_vidh:
413 * to be picked, while the older one has to be dropped. This function returns 411 * to be picked, while the older one has to be dropped. This function returns
414 * zero in case of success and a negative error code in case of failure. 412 * zero in case of success and a negative error code in case of failure.
415 */ 413 */
416int ubi_scan_add_used(const struct ubi_device *ubi, struct ubi_scan_info *si, 414int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
417 int pnum, int ec, const struct ubi_vid_hdr *vid_hdr, 415 int pnum, int ec, const struct ubi_vid_hdr *vid_hdr,
418 int bitflips) 416 int bitflips)
419{ 417{
@@ -667,8 +665,8 @@ void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
667 * function returns zero in case of success and a negative error code in case 665 * function returns zero in case of success and a negative error code in case
668 * of failure. 666 * of failure.
669 */ 667 */
670int ubi_scan_erase_peb(const struct ubi_device *ubi, 668int ubi_scan_erase_peb(struct ubi_device *ubi, const struct ubi_scan_info *si,
671 const struct ubi_scan_info *si, int pnum, int ec) 669 int pnum, int ec)
672{ 670{
673 int err; 671 int err;
674 struct ubi_ec_hdr *ec_hdr; 672 struct ubi_ec_hdr *ec_hdr;
@@ -712,7 +710,7 @@ out_free:
712 * This function returns scanning physical eraseblock information in case of 710 * This function returns scanning physical eraseblock information in case of
713 * success and an error code in case of failure. 711 * success and an error code in case of failure.
714 */ 712 */
715struct ubi_scan_leb *ubi_scan_get_free_peb(const struct ubi_device *ubi, 713struct ubi_scan_leb *ubi_scan_get_free_peb(struct ubi_device *ubi,
716 struct ubi_scan_info *si) 714 struct ubi_scan_info *si)
717{ 715{
718 int err = 0, i; 716 int err = 0, i;
@@ -1110,8 +1108,7 @@ void ubi_scan_destroy_si(struct ubi_scan_info *si)
1110 * This function returns zero if the scanning information is all right, %1 if 1108 * This function returns zero if the scanning information is all right, %1 if
1111 * not and a negative error code if an error occurred. 1109 * not and a negative error code if an error occurred.
1112 */ 1110 */
1113static int paranoid_check_si(const struct ubi_device *ubi, 1111static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si)
1114 struct ubi_scan_info *si)
1115{ 1112{
1116 int pnum, err, vols_found = 0; 1113 int pnum, err, vols_found = 0;
1117 struct rb_node *rb1, *rb2; 1114 struct rb_node *rb1, *rb2;