aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-27 07:43:54 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-09-04 02:39:01 -0400
commit049333cecbde11988c49ad4d7861eefbc3534422 (patch)
tree75ad7eb414574bedf7438accbe9de2c9a70e0014 /drivers
parent193819cf2e6e395b1e1be2d36785dc5563a6edca (diff)
UBI: comply with coding style
Join all the split printk lines in order to stop checkpatch complaining. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/ubi/attach.c28
-rw-r--r--drivers/mtd/ubi/build.c22
-rw-r--r--drivers/mtd/ubi/cdev.c9
-rw-r--r--drivers/mtd/ubi/debug.c4
-rw-r--r--drivers/mtd/ubi/eba.c33
-rw-r--r--drivers/mtd/ubi/gluebi.c28
-rw-r--r--drivers/mtd/ubi/io.c78
-rw-r--r--drivers/mtd/ubi/misc.c4
-rw-r--r--drivers/mtd/ubi/vtbl.c8
9 files changed, 101 insertions, 113 deletions
diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 68d4d1f76d1e..d8e92b6a33f6 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -378,8 +378,8 @@ static int compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb,
378 if (err == UBI_IO_BITFLIPS) 378 if (err == UBI_IO_BITFLIPS)
379 bitflips = 1; 379 bitflips = 1;
380 else { 380 else {
381 ubi_err("VID of PEB %d header is bad, but it " 381 ubi_err("VID of PEB %d header is bad, but it was OK earlier, err %d",
382 "was OK earlier, err %d", pnum, err); 382 pnum, err);
383 if (err > 0) 383 if (err > 0)
384 err = -EIO; 384 err = -EIO;
385 385
@@ -790,9 +790,9 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
790 if (ubi_check_pattern(ubi->peb_buf, 0xFF, ubi->leb_size)) 790 if (ubi_check_pattern(ubi->peb_buf, 0xFF, ubi->leb_size))
791 goto out_unlock; 791 goto out_unlock;
792 792
793 ubi_err("PEB %d contains corrupted VID header, and the data does not " 793 ubi_err("PEB %d contains corrupted VID header, and the data does not contain all 0xFF",
794 "contain all 0xFF, this may be a non-UBI PEB or a severe VID " 794 pnum);
795 "header corruption which requires manual inspection", pnum); 795 ubi_err("this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection");
796 ubi_dump_vid_hdr(vid_hdr); 796 ubi_dump_vid_hdr(vid_hdr);
797 dbg_msg("hexdump of PEB %d offset %d, length %d", 797 dbg_msg("hexdump of PEB %d offset %d, length %d",
798 pnum, ubi->leb_start, ubi->leb_size); 798 pnum, ubi->leb_start, ubi->leb_size);
@@ -907,8 +907,8 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai,
907 ubi->image_seq = image_seq; 907 ubi->image_seq = image_seq;
908 if (ubi->image_seq && image_seq && 908 if (ubi->image_seq && image_seq &&
909 ubi->image_seq != image_seq) { 909 ubi->image_seq != image_seq) {
910 ubi_err("bad image sequence number %d in PEB %d, " 910 ubi_err("bad image sequence number %d in PEB %d, expected %d",
911 "expected %d", image_seq, pnum, ubi->image_seq); 911 image_seq, pnum, ubi->image_seq);
912 ubi_dump_ec_hdr(ech); 912 ubi_dump_ec_hdr(ech);
913 return -EINVAL; 913 return -EINVAL;
914 } 914 }
@@ -997,8 +997,8 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai,
997 /* Unsupported internal volume */ 997 /* Unsupported internal volume */
998 switch (vidh->compat) { 998 switch (vidh->compat) {
999 case UBI_COMPAT_DELETE: 999 case UBI_COMPAT_DELETE:
1000 ubi_msg("\"delete\" compatible internal volume %d:%d" 1000 ubi_msg("\"delete\" compatible internal volume %d:%d found, will remove it",
1001 " found, will remove it", vol_id, lnum); 1001 vol_id, lnum);
1002 err = add_to_list(ai, pnum, vol_id, lnum, 1002 err = add_to_list(ai, pnum, vol_id, lnum,
1003 ec, 1, &ai->erase); 1003 ec, 1, &ai->erase);
1004 if (err) 1004 if (err)
@@ -1006,15 +1006,14 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai,
1006 return 0; 1006 return 0;
1007 1007
1008 case UBI_COMPAT_RO: 1008 case UBI_COMPAT_RO:
1009 ubi_msg("read-only compatible internal volume %d:%d" 1009 ubi_msg("read-only compatible internal volume %d:%d found, switch to read-only mode",
1010 " found, switch to read-only mode",
1011 vol_id, lnum); 1010 vol_id, lnum);
1012 ubi->ro_mode = 1; 1011 ubi->ro_mode = 1;
1013 break; 1012 break;
1014 1013
1015 case UBI_COMPAT_PRESERVE: 1014 case UBI_COMPAT_PRESERVE:
1016 ubi_msg("\"preserve\" compatible internal volume %d:%d" 1015 ubi_msg("\"preserve\" compatible internal volume %d:%d found",
1017 " found", vol_id, lnum); 1016 vol_id, lnum);
1018 err = add_to_list(ai, pnum, vol_id, lnum, 1017 err = add_to_list(ai, pnum, vol_id, lnum,
1019 ec, 0, &ai->alien); 1018 ec, 0, &ai->alien);
1020 if (err) 1019 if (err)
@@ -1112,8 +1111,7 @@ static int late_analysis(struct ubi_device *ubi, struct ubi_attach_info *ai)
1112 get_random_bytes(&ubi->image_seq, 1111 get_random_bytes(&ubi->image_seq,
1113 sizeof(ubi->image_seq)); 1112 sizeof(ubi->image_seq));
1114 } else { 1113 } else {
1115 ubi_err("MTD device is not UBI-formatted and possibly " 1114 ubi_err("MTD device is not UBI-formatted and possibly contains non-UBI data - refusing it");
1116 "contains non-UBI data - refusing it");
1117 return -EINVAL; 1115 return -EINVAL;
1118 } 1116 }
1119 1117
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 89660881aa31..dd9bc0a5cc31 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -748,16 +748,15 @@ static int io_init(struct ubi_device *ubi, int max_beb_per1024)
748 * read-only mode. 748 * read-only mode.
749 */ 749 */
750 if (ubi->vid_hdr_offset + UBI_VID_HDR_SIZE <= ubi->hdrs_min_io_size) { 750 if (ubi->vid_hdr_offset + UBI_VID_HDR_SIZE <= ubi->hdrs_min_io_size) {
751 ubi_warn("EC and VID headers are in the same minimal I/O unit, " 751 ubi_warn("EC and VID headers are in the same minimal I/O unit, switch to read-only mode");
752 "switch to read-only mode");
753 ubi->ro_mode = 1; 752 ubi->ro_mode = 1;
754 } 753 }
755 754
756 ubi->leb_size = ubi->peb_size - ubi->leb_start; 755 ubi->leb_size = ubi->peb_size - ubi->leb_start;
757 756
758 if (!(ubi->mtd->flags & MTD_WRITEABLE)) { 757 if (!(ubi->mtd->flags & MTD_WRITEABLE)) {
759 ubi_msg("MTD device %d is write-protected, attach in " 758 ubi_msg("MTD device %d is write-protected, attach in read-only mode",
760 "read-only mode", ubi->mtd->index); 759 ubi->mtd->index);
761 ubi->ro_mode = 1; 760 ubi->ro_mode = 1;
762 } 761 }
763 762
@@ -892,8 +891,8 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
892 * no sense to attach emulated MTD devices, so we prohibit this. 891 * no sense to attach emulated MTD devices, so we prohibit this.
893 */ 892 */
894 if (mtd->type == MTD_UBIVOLUME) { 893 if (mtd->type == MTD_UBIVOLUME) {
895 ubi_err("refuse attaching mtd%d - it is already emulated on " 894 ubi_err("refuse attaching mtd%d - it is already emulated on top of UBI",
896 "top of UBI", mtd->index); 895 mtd->index);
897 return -EINVAL; 896 return -EINVAL;
898 } 897 }
899 898
@@ -1357,14 +1356,13 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
1357 1356
1358 len = strnlen(val, MTD_PARAM_LEN_MAX); 1357 len = strnlen(val, MTD_PARAM_LEN_MAX);
1359 if (len == MTD_PARAM_LEN_MAX) { 1358 if (len == MTD_PARAM_LEN_MAX) {
1360 printk(KERN_ERR "UBI error: parameter \"%s\" is too long, " 1359 printk(KERN_ERR "UBI error: parameter \"%s\" is too long, max. is %d\n",
1361 "max. is %d\n", val, MTD_PARAM_LEN_MAX); 1360 val, MTD_PARAM_LEN_MAX);
1362 return -EINVAL; 1361 return -EINVAL;
1363 } 1362 }
1364 1363
1365 if (len == 0) { 1364 if (len == 0) {
1366 printk(KERN_WARNING "UBI warning: empty 'mtd=' parameter - " 1365 printk(KERN_WARNING "UBI warning: empty 'mtd=' parameter - ignored\n");
1367 "ignored\n");
1368 return 0; 1366 return 0;
1369 } 1367 }
1370 1368
@@ -1396,8 +1394,8 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
1396 int err = kstrtoint(tokens[2], 10, &p->max_beb_per1024); 1394 int err = kstrtoint(tokens[2], 10, &p->max_beb_per1024);
1397 1395
1398 if (err) { 1396 if (err) {
1399 printk(KERN_ERR "UBI error: bad value for " 1397 printk(KERN_ERR "UBI error: bad value for max_beb_per1024 parameter: %s",
1400 "max_beb_per1024 parameter: %s", tokens[2]); 1398 tokens[2]);
1401 return -EINVAL; 1399 return -EINVAL;
1402 } 1400 }
1403 } 1401 }
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 7885dc0934ce..540d2db492ee 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -140,9 +140,9 @@ static int vol_cdev_release(struct inode *inode, struct file *file)
140 vol->updating = 0; 140 vol->updating = 0;
141 vfree(vol->upd_buf); 141 vfree(vol->upd_buf);
142 } else if (vol->changing_leb) { 142 } else if (vol->changing_leb) {
143 dbg_gen("only %lld of %lld bytes received for atomic LEB change" 143 dbg_gen("only %lld of %lld bytes received for atomic LEB change for volume %d:%d, cancel",
144 " for volume %d:%d, cancel", vol->upd_received, 144 vol->upd_received, vol->upd_bytes, vol->ubi->ubi_num,
145 vol->upd_bytes, vol->ubi->ubi_num, vol->vol_id); 145 vol->vol_id);
146 vol->changing_leb = 0; 146 vol->changing_leb = 0;
147 vfree(vol->upd_buf); 147 vfree(vol->upd_buf);
148 } 148 }
@@ -189,7 +189,8 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin)
189 return new_offset; 189 return new_offset;
190} 190}
191 191
192static int vol_cdev_fsync(struct file *file, loff_t start, loff_t end, int datasync) 192static int vol_cdev_fsync(struct file *file, loff_t start, loff_t end,
193 int datasync)
193{ 194{
194 struct ubi_volume_desc *desc = file->private_data; 195 struct ubi_volume_desc *desc = file->private_data;
195 struct ubi_device *ubi = desc->vol->ubi; 196 struct ubi_device *ubi = desc->vol->ubi;
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
index 7c1380305219..dd97324f3a13 100644
--- a/drivers/mtd/ubi/debug.c
+++ b/drivers/mtd/ubi/debug.c
@@ -43,8 +43,8 @@ void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len)
43 return; 43 return;
44 err = mtd_read(ubi->mtd, addr, len, &read, buf); 44 err = mtd_read(ubi->mtd, addr, len, &read, buf);
45 if (err && err != -EUCLEAN) { 45 if (err && err != -EUCLEAN) {
46 ubi_err("error %d while reading %d bytes from PEB %d:%d, " 46 ubi_err("error %d while reading %d bytes from PEB %d:%d, read %zd bytes",
47 "read %zd bytes", err, len, pnum, offset, read); 47 err, len, pnum, offset, read);
48 goto out; 48 goto out;
49 } 49 }
50 50
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index b703ac7729cf..a26d7d253174 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -420,9 +420,8 @@ retry:
420 */ 420 */
421 if (err == UBI_IO_BAD_HDR_EBADMSG || 421 if (err == UBI_IO_BAD_HDR_EBADMSG ||
422 err == UBI_IO_BAD_HDR) { 422 err == UBI_IO_BAD_HDR) {
423 ubi_warn("corrupted VID header at PEB " 423 ubi_warn("corrupted VID header at PEB %d, LEB %d:%d",
424 "%d, LEB %d:%d", pnum, vol_id, 424 pnum, vol_id, lnum);
425 lnum);
426 err = -EBADMSG; 425 err = -EBADMSG;
427 } else 426 } else
428 ubi_ro_mode(ubi); 427 ubi_ro_mode(ubi);
@@ -660,9 +659,8 @@ retry:
660 if (len) { 659 if (len) {
661 err = ubi_io_write_data(ubi, buf, pnum, offset, len); 660 err = ubi_io_write_data(ubi, buf, pnum, offset, len);
662 if (err) { 661 if (err) {
663 ubi_warn("failed to write %d bytes at offset %d of " 662 ubi_warn("failed to write %d bytes at offset %d of LEB %d:%d, PEB %d",
664 "LEB %d:%d, PEB %d", len, offset, vol_id, 663 len, offset, vol_id, lnum, pnum);
665 lnum, pnum);
666 goto write_error; 664 goto write_error;
667 } 665 }
668 } 666 }
@@ -1040,9 +1038,8 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
1040 * cancel it. 1038 * cancel it.
1041 */ 1039 */
1042 if (vol->eba_tbl[lnum] != from) { 1040 if (vol->eba_tbl[lnum] != from) {
1043 dbg_wl("LEB %d:%d is no longer mapped to PEB %d, mapped to " 1041 dbg_wl("LEB %d:%d is no longer mapped to PEB %d, mapped to PEB %d, cancel",
1044 "PEB %d, cancel", vol_id, lnum, from, 1042 vol_id, lnum, from, vol->eba_tbl[lnum]);
1045 vol->eba_tbl[lnum]);
1046 err = MOVE_CANCEL_RACE; 1043 err = MOVE_CANCEL_RACE;
1047 goto out_unlock_leb; 1044 goto out_unlock_leb;
1048 } 1045 }
@@ -1107,8 +1104,8 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
1107 err = ubi_io_read_vid_hdr(ubi, to, vid_hdr, 1); 1104 err = ubi_io_read_vid_hdr(ubi, to, vid_hdr, 1);
1108 if (err) { 1105 if (err) {
1109 if (err != UBI_IO_BITFLIPS) { 1106 if (err != UBI_IO_BITFLIPS) {
1110 ubi_warn("error %d while reading VID header back from " 1107 ubi_warn("error %d while reading VID header back from PEB %d",
1111 "PEB %d", err, to); 1108 err, to);
1112 if (is_error_sane(err)) 1109 if (is_error_sane(err))
1113 err = MOVE_TARGET_RD_ERR; 1110 err = MOVE_TARGET_RD_ERR;
1114 } else 1111 } else
@@ -1134,8 +1131,8 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
1134 err = ubi_io_read_data(ubi, ubi->peb_buf, to, 0, aldata_size); 1131 err = ubi_io_read_data(ubi, ubi->peb_buf, to, 0, aldata_size);
1135 if (err) { 1132 if (err) {
1136 if (err != UBI_IO_BITFLIPS) { 1133 if (err != UBI_IO_BITFLIPS) {
1137 ubi_warn("error %d while reading data back " 1134 ubi_warn("error %d while reading data back from PEB %d",
1138 "from PEB %d", err, to); 1135 err, to);
1139 if (is_error_sane(err)) 1136 if (is_error_sane(err))
1140 err = MOVE_TARGET_RD_ERR; 1137 err = MOVE_TARGET_RD_ERR;
1141 } else 1138 } else
@@ -1146,8 +1143,8 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
1146 cond_resched(); 1143 cond_resched();
1147 1144
1148 if (crc != crc32(UBI_CRC32_INIT, ubi->peb_buf, data_size)) { 1145 if (crc != crc32(UBI_CRC32_INIT, ubi->peb_buf, data_size)) {
1149 ubi_warn("read data back from PEB %d and it is " 1146 ubi_warn("read data back from PEB %d and it is different",
1150 "different", to); 1147 to);
1151 err = -EINVAL; 1148 err = -EINVAL;
1152 goto out_unlock_buf; 1149 goto out_unlock_buf;
1153 } 1150 }
@@ -1197,11 +1194,11 @@ static void print_rsvd_warning(struct ubi_device *ubi,
1197 return; 1194 return;
1198 } 1195 }
1199 1196
1200 ubi_warn("cannot reserve enough PEBs for bad PEB handling, reserved %d," 1197 ubi_warn("cannot reserve enough PEBs for bad PEB handling, reserved %d, need %d",
1201 " need %d", ubi->beb_rsvd_pebs, ubi->beb_rsvd_level); 1198 ubi->beb_rsvd_pebs, ubi->beb_rsvd_level);
1202 if (ubi->corr_peb_count) 1199 if (ubi->corr_peb_count)
1203 ubi_warn("%d PEBs are corrupted and not used", 1200 ubi_warn("%d PEBs are corrupted and not used",
1204 ubi->corr_peb_count); 1201 ubi->corr_peb_count);
1205} 1202}
1206 1203
1207/** 1204/**
diff --git a/drivers/mtd/ubi/gluebi.c b/drivers/mtd/ubi/gluebi.c
index 4e44bee4c564..c25aa2906413 100644
--- a/drivers/mtd/ubi/gluebi.c
+++ b/drivers/mtd/ubi/gluebi.c
@@ -341,9 +341,8 @@ static int gluebi_create(struct ubi_device_info *di,
341 mutex_lock(&devices_mutex); 341 mutex_lock(&devices_mutex);
342 g = find_gluebi_nolock(vi->ubi_num, vi->vol_id); 342 g = find_gluebi_nolock(vi->ubi_num, vi->vol_id);
343 if (g) 343 if (g)
344 err_msg("gluebi MTD device %d form UBI device %d volume %d " 344 err_msg("gluebi MTD device %d form UBI device %d volume %d already exists",
345 "already exists", g->mtd.index, vi->ubi_num, 345 g->mtd.index, vi->ubi_num, vi->vol_id);
346 vi->vol_id);
347 mutex_unlock(&devices_mutex); 346 mutex_unlock(&devices_mutex);
348 347
349 if (mtd_device_register(mtd, NULL, 0)) { 348 if (mtd_device_register(mtd, NULL, 0)) {
@@ -376,8 +375,8 @@ static int gluebi_remove(struct ubi_volume_info *vi)
376 mutex_lock(&devices_mutex); 375 mutex_lock(&devices_mutex);
377 gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id); 376 gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id);
378 if (!gluebi) { 377 if (!gluebi) {
379 err_msg("got remove notification for unknown UBI device %d " 378 err_msg("got remove notification for unknown UBI device %d volume %d",
380 "volume %d", vi->ubi_num, vi->vol_id); 379 vi->ubi_num, vi->vol_id);
381 err = -ENOENT; 380 err = -ENOENT;
382 } else if (gluebi->refcnt) 381 } else if (gluebi->refcnt)
383 err = -EBUSY; 382 err = -EBUSY;
@@ -390,9 +389,8 @@ static int gluebi_remove(struct ubi_volume_info *vi)
390 mtd = &gluebi->mtd; 389 mtd = &gluebi->mtd;
391 err = mtd_device_unregister(mtd); 390 err = mtd_device_unregister(mtd);
392 if (err) { 391 if (err) {
393 err_msg("cannot remove fake MTD device %d, UBI device %d, " 392 err_msg("cannot remove fake MTD device %d, UBI device %d, volume %d, error %d",
394 "volume %d, error %d", mtd->index, gluebi->ubi_num, 393 mtd->index, gluebi->ubi_num, gluebi->vol_id, err);
395 gluebi->vol_id, err);
396 mutex_lock(&devices_mutex); 394 mutex_lock(&devices_mutex);
397 list_add_tail(&gluebi->list, &gluebi_devices); 395 list_add_tail(&gluebi->list, &gluebi_devices);
398 mutex_unlock(&devices_mutex); 396 mutex_unlock(&devices_mutex);
@@ -422,8 +420,8 @@ static int gluebi_updated(struct ubi_volume_info *vi)
422 gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id); 420 gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id);
423 if (!gluebi) { 421 if (!gluebi) {
424 mutex_unlock(&devices_mutex); 422 mutex_unlock(&devices_mutex);
425 err_msg("got update notification for unknown UBI device %d " 423 err_msg("got update notification for unknown UBI device %d volume %d",
426 "volume %d", vi->ubi_num, vi->vol_id); 424 vi->ubi_num, vi->vol_id);
427 return -ENOENT; 425 return -ENOENT;
428 } 426 }
429 427
@@ -449,8 +447,8 @@ static int gluebi_resized(struct ubi_volume_info *vi)
449 gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id); 447 gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id);
450 if (!gluebi) { 448 if (!gluebi) {
451 mutex_unlock(&devices_mutex); 449 mutex_unlock(&devices_mutex);
452 err_msg("got update notification for unknown UBI device %d " 450 err_msg("got update notification for unknown UBI device %d volume %d",
453 "volume %d", vi->ubi_num, vi->vol_id); 451 vi->ubi_num, vi->vol_id);
454 return -ENOENT; 452 return -ENOENT;
455 } 453 }
456 gluebi->mtd.size = vi->used_bytes; 454 gluebi->mtd.size = vi->used_bytes;
@@ -507,9 +505,9 @@ static void __exit ubi_gluebi_exit(void)
507 505
508 err = mtd_device_unregister(mtd); 506 err = mtd_device_unregister(mtd);
509 if (err) 507 if (err)
510 err_msg("error %d while removing gluebi MTD device %d, " 508 err_msg("error %d while removing gluebi MTD device %d, UBI device %d, volume %d - ignoring",
511 "UBI device %d, volume %d - ignoring", err, 509 err, mtd->index, gluebi->ubi_num,
512 mtd->index, gluebi->ubi_num, gluebi->vol_id); 510 gluebi->vol_id);
513 kfree(mtd->name); 511 kfree(mtd->name);
514 kfree(gluebi); 512 kfree(gluebi);
515 } 513 }
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index a8d523794b52..321541159f51 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -183,15 +183,14 @@ retry:
183 } 183 }
184 184
185 if (retries++ < UBI_IO_RETRIES) { 185 if (retries++ < UBI_IO_RETRIES) {
186 ubi_warn("error %d%s while reading %d bytes from PEB " 186 ubi_warn("error %d%s while reading %d bytes from PEB %d:%d, read only %zd bytes, retry",
187 "%d:%d, read only %zd bytes, retry",
188 err, errstr, len, pnum, offset, read); 187 err, errstr, len, pnum, offset, read);
189 yield(); 188 yield();
190 goto retry; 189 goto retry;
191 } 190 }
192 191
193 ubi_err("error %d%s while reading %d bytes from PEB %d:%d, " 192 ubi_err("error %d%s while reading %d bytes from PEB %d:%d, read %zd bytes",
194 "read %zd bytes", err, errstr, len, pnum, offset, read); 193 err, errstr, len, pnum, offset, read);
195 dump_stack(); 194 dump_stack();
196 195
197 /* 196 /*
@@ -274,8 +273,8 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
274 } 273 }
275 274
276 if (ubi_dbg_is_write_failure(ubi)) { 275 if (ubi_dbg_is_write_failure(ubi)) {
277 ubi_err("cannot write %d bytes to PEB %d:%d " 276 ubi_err("cannot write %d bytes to PEB %d:%d (emulated)",
278 "(emulated)", len, pnum, offset); 277 len, pnum, offset);
279 dump_stack(); 278 dump_stack();
280 return -EIO; 279 return -EIO;
281 } 280 }
@@ -283,8 +282,8 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
283 addr = (loff_t)pnum * ubi->peb_size + offset; 282 addr = (loff_t)pnum * ubi->peb_size + offset;
284 err = mtd_write(ubi->mtd, addr, len, &written, buf); 283 err = mtd_write(ubi->mtd, addr, len, &written, buf);
285 if (err) { 284 if (err) {
286 ubi_err("error %d while writing %d bytes to PEB %d:%d, written " 285 ubi_err("error %d while writing %d bytes to PEB %d:%d, written %zd bytes",
287 "%zd bytes", err, len, pnum, offset, written); 286 err, len, pnum, offset, written);
288 dump_stack(); 287 dump_stack();
289 ubi_dump_flash(ubi, pnum, offset, len); 288 ubi_dump_flash(ubi, pnum, offset, len);
290 } else 289 } else
@@ -685,8 +684,7 @@ static int validate_ec_hdr(const struct ubi_device *ubi,
685 leb_start = be32_to_cpu(ec_hdr->data_offset); 684 leb_start = be32_to_cpu(ec_hdr->data_offset);
686 685
687 if (ec_hdr->version != UBI_VERSION) { 686 if (ec_hdr->version != UBI_VERSION) {
688 ubi_err("node with incompatible UBI version found: " 687 ubi_err("node with incompatible UBI version found: this UBI version is %d, image version is %d",
689 "this UBI version is %d, image version is %d",
690 UBI_VERSION, (int)ec_hdr->version); 688 UBI_VERSION, (int)ec_hdr->version);
691 goto bad; 689 goto bad;
692 } 690 }
@@ -777,10 +775,10 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
777 if (ubi_check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) { 775 if (ubi_check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) {
778 /* The physical eraseblock is supposedly empty */ 776 /* The physical eraseblock is supposedly empty */
779 if (verbose) 777 if (verbose)
780 ubi_warn("no EC header found at PEB %d, " 778 ubi_warn("no EC header found at PEB %d, only 0xFF bytes",
781 "only 0xFF bytes", pnum); 779 pnum);
782 dbg_bld("no EC header found at PEB %d, " 780 dbg_bld("no EC header found at PEB %d, only 0xFF bytes",
783 "only 0xFF bytes", pnum); 781 pnum);
784 if (!read_err) 782 if (!read_err)
785 return UBI_IO_FF; 783 return UBI_IO_FF;
786 else 784 else
@@ -792,12 +790,12 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
792 * 0xFF bytes. Report that the header is corrupted. 790 * 0xFF bytes. Report that the header is corrupted.
793 */ 791 */
794 if (verbose) { 792 if (verbose) {
795 ubi_warn("bad magic number at PEB %d: %08x instead of " 793 ubi_warn("bad magic number at PEB %d: %08x instead of %08x",
796 "%08x", pnum, magic, UBI_EC_HDR_MAGIC); 794 pnum, magic, UBI_EC_HDR_MAGIC);
797 ubi_dump_ec_hdr(ec_hdr); 795 ubi_dump_ec_hdr(ec_hdr);
798 } 796 }
799 dbg_bld("bad magic number at PEB %d: %08x instead of " 797 dbg_bld("bad magic number at PEB %d: %08x instead of %08x",
800 "%08x", pnum, magic, UBI_EC_HDR_MAGIC); 798 pnum, magic, UBI_EC_HDR_MAGIC);
801 return UBI_IO_BAD_HDR; 799 return UBI_IO_BAD_HDR;
802 } 800 }
803 801
@@ -806,12 +804,12 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
806 804
807 if (hdr_crc != crc) { 805 if (hdr_crc != crc) {
808 if (verbose) { 806 if (verbose) {
809 ubi_warn("bad EC header CRC at PEB %d, calculated " 807 ubi_warn("bad EC header CRC at PEB %d, calculated %#08x, read %#08x",
810 "%#08x, read %#08x", pnum, crc, hdr_crc); 808 pnum, crc, hdr_crc);
811 ubi_dump_ec_hdr(ec_hdr); 809 ubi_dump_ec_hdr(ec_hdr);
812 } 810 }
813 dbg_bld("bad EC header CRC at PEB %d, calculated " 811 dbg_bld("bad EC header CRC at PEB %d, calculated %#08x, read %#08x",
814 "%#08x, read %#08x", pnum, crc, hdr_crc); 812 pnum, crc, hdr_crc);
815 813
816 if (!read_err) 814 if (!read_err)
817 return UBI_IO_BAD_HDR; 815 return UBI_IO_BAD_HDR;
@@ -1032,10 +1030,10 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
1032 1030
1033 if (ubi_check_pattern(vid_hdr, 0xFF, UBI_VID_HDR_SIZE)) { 1031 if (ubi_check_pattern(vid_hdr, 0xFF, UBI_VID_HDR_SIZE)) {
1034 if (verbose) 1032 if (verbose)
1035 ubi_warn("no VID header found at PEB %d, " 1033 ubi_warn("no VID header found at PEB %d, only 0xFF bytes",
1036 "only 0xFF bytes", pnum); 1034 pnum);
1037 dbg_bld("no VID header found at PEB %d, " 1035 dbg_bld("no VID header found at PEB %d, only 0xFF bytes",
1038 "only 0xFF bytes", pnum); 1036 pnum);
1039 if (!read_err) 1037 if (!read_err)
1040 return UBI_IO_FF; 1038 return UBI_IO_FF;
1041 else 1039 else
@@ -1043,12 +1041,12 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
1043 } 1041 }
1044 1042
1045 if (verbose) { 1043 if (verbose) {
1046 ubi_warn("bad magic number at PEB %d: %08x instead of " 1044 ubi_warn("bad magic number at PEB %d: %08x instead of %08x",
1047 "%08x", pnum, magic, UBI_VID_HDR_MAGIC); 1045 pnum, magic, UBI_VID_HDR_MAGIC);
1048 ubi_dump_vid_hdr(vid_hdr); 1046 ubi_dump_vid_hdr(vid_hdr);
1049 } 1047 }
1050 dbg_bld("bad magic number at PEB %d: %08x instead of " 1048 dbg_bld("bad magic number at PEB %d: %08x instead of %08x",
1051 "%08x", pnum, magic, UBI_VID_HDR_MAGIC); 1049 pnum, magic, UBI_VID_HDR_MAGIC);
1052 return UBI_IO_BAD_HDR; 1050 return UBI_IO_BAD_HDR;
1053 } 1051 }
1054 1052
@@ -1057,12 +1055,12 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
1057 1055
1058 if (hdr_crc != crc) { 1056 if (hdr_crc != crc) {
1059 if (verbose) { 1057 if (verbose) {
1060 ubi_warn("bad CRC at PEB %d, calculated %#08x, " 1058 ubi_warn("bad CRC at PEB %d, calculated %#08x, read %#08x",
1061 "read %#08x", pnum, crc, hdr_crc); 1059 pnum, crc, hdr_crc);
1062 ubi_dump_vid_hdr(vid_hdr); 1060 ubi_dump_vid_hdr(vid_hdr);
1063 } 1061 }
1064 dbg_bld("bad CRC at PEB %d, calculated %#08x, " 1062 dbg_bld("bad CRC at PEB %d, calculated %#08x, read %#08x",
1065 "read %#08x", pnum, crc, hdr_crc); 1063 pnum, crc, hdr_crc);
1066 if (!read_err) 1064 if (!read_err)
1067 return UBI_IO_BAD_HDR; 1065 return UBI_IO_BAD_HDR;
1068 else 1066 else
@@ -1300,8 +1298,8 @@ static int self_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum)
1300 crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_EC_HDR_SIZE_CRC); 1298 crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_EC_HDR_SIZE_CRC);
1301 hdr_crc = be32_to_cpu(vid_hdr->hdr_crc); 1299 hdr_crc = be32_to_cpu(vid_hdr->hdr_crc);
1302 if (hdr_crc != crc) { 1300 if (hdr_crc != crc) {
1303 ubi_err("bad VID header CRC at PEB %d, calculated %#08x, " 1301 ubi_err("bad VID header CRC at PEB %d, calculated %#08x, read %#08x",
1304 "read %#08x", pnum, crc, hdr_crc); 1302 pnum, crc, hdr_crc);
1305 ubi_err("self-check failed for PEB %d", pnum); 1303 ubi_err("self-check failed for PEB %d", pnum);
1306 ubi_dump_vid_hdr(vid_hdr); 1304 ubi_dump_vid_hdr(vid_hdr);
1307 dump_stack(); 1305 dump_stack();
@@ -1411,15 +1409,15 @@ int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len)
1411 1409
1412 err = mtd_read(ubi->mtd, addr, len, &read, buf); 1410 err = mtd_read(ubi->mtd, addr, len, &read, buf);
1413 if (err && !mtd_is_bitflip(err)) { 1411 if (err && !mtd_is_bitflip(err)) {
1414 ubi_err("error %d while reading %d bytes from PEB %d:%d, " 1412 ubi_err("error %d while reading %d bytes from PEB %d:%d, read %zd bytes",
1415 "read %zd bytes", err, len, pnum, offset, read); 1413 err, len, pnum, offset, read);
1416 goto error; 1414 goto error;
1417 } 1415 }
1418 1416
1419 err = ubi_check_pattern(buf, 0xFF, len); 1417 err = ubi_check_pattern(buf, 0xFF, len);
1420 if (err == 0) { 1418 if (err == 0) {
1421 ubi_err("flash region at PEB %d:%d, length %d does not " 1419 ubi_err("flash region at PEB %d:%d, length %d does not contain all 0xFF bytes",
1422 "contain all 0xFF bytes", pnum, offset, len); 1420 pnum, offset, len);
1423 goto fail; 1421 goto fail;
1424 } 1422 }
1425 1423
diff --git a/drivers/mtd/ubi/misc.c b/drivers/mtd/ubi/misc.c
index d089df055484..f913d701a5b3 100644
--- a/drivers/mtd/ubi/misc.c
+++ b/drivers/mtd/ubi/misc.c
@@ -128,9 +128,7 @@ void ubi_calculate_reserved(struct ubi_device *ubi)
128 ubi->beb_rsvd_level = ubi->bad_peb_limit - ubi->bad_peb_count; 128 ubi->beb_rsvd_level = ubi->bad_peb_limit - ubi->bad_peb_count;
129 if (ubi->beb_rsvd_level < 0) { 129 if (ubi->beb_rsvd_level < 0) {
130 ubi->beb_rsvd_level = 0; 130 ubi->beb_rsvd_level = 0;
131 ubi_warn("number of bad PEBs (%d) is above the expected limit " 131 ubi_warn("number of bad PEBs (%d) is above the expected limit (%d), not reserving any PEBs for bad PEB handling, will use available PEBs (if any)",
132 "(%d), not reserving any PEBs for bad PEB handling, "
133 "will use available PEBs (if any)",
134 ubi->bad_peb_count, ubi->bad_peb_limit); 132 ubi->bad_peb_count, ubi->bad_peb_limit);
135 } 133 }
136} 134}
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index 437bc193e170..7e7c20114edb 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -270,8 +270,8 @@ static int vtbl_check(const struct ubi_device *ubi,
270 270
271 if (len1 > 0 && len1 == len2 && 271 if (len1 > 0 && len1 == len2 &&
272 !strncmp(vtbl[i].name, vtbl[n].name, len1)) { 272 !strncmp(vtbl[i].name, vtbl[n].name, len1)) {
273 ubi_err("volumes %d and %d have the same name" 273 ubi_err("volumes %d and %d have the same name \"%s\"",
274 " \"%s\"", i, n, vtbl[i].name); 274 i, n, vtbl[i].name);
275 ubi_dump_vtbl_record(&vtbl[i], i); 275 ubi_dump_vtbl_record(&vtbl[i], i);
276 ubi_dump_vtbl_record(&vtbl[n], n); 276 ubi_dump_vtbl_record(&vtbl[n], n);
277 return -EINVAL; 277 return -EINVAL;
@@ -562,8 +562,8 @@ static int init_volumes(struct ubi_device *ubi,
562 if (vtbl[i].flags & UBI_VTBL_AUTORESIZE_FLG) { 562 if (vtbl[i].flags & UBI_VTBL_AUTORESIZE_FLG) {
563 /* Auto re-size flag may be set only for one volume */ 563 /* Auto re-size flag may be set only for one volume */
564 if (ubi->autoresize_vol_id != -1) { 564 if (ubi->autoresize_vol_id != -1) {
565 ubi_err("more than one auto-resize volume (%d " 565 ubi_err("more than one auto-resize volume (%d and %d)",
566 "and %d)", ubi->autoresize_vol_id, i); 566 ubi->autoresize_vol_id, i);
567 kfree(vol); 567 kfree(vol);
568 return -EINVAL; 568 return -EINVAL;
569 } 569 }