···378378 if (err == UBI_IO_BITFLIPS)379379 bitflips = 1;380380 else {381381- ubi_err("VID of PEB %d header is bad, but it "382382- "was OK earlier, err %d", pnum, err);381381+ ubi_err("VID of PEB %d header is bad, but it was OK earlier, err %d",382382+ pnum, err);383383 if (err > 0)384384 err = -EIO;385385···790790 if (ubi_check_pattern(ubi->peb_buf, 0xFF, ubi->leb_size))791791 goto out_unlock;792792793793- ubi_err("PEB %d contains corrupted VID header, and the data does not "794794- "contain all 0xFF, this may be a non-UBI PEB or a severe VID "795795- "header corruption which requires manual inspection", pnum);793793+ ubi_err("PEB %d contains corrupted VID header, and the data does not contain all 0xFF",794794+ pnum);795795+ ubi_err("this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection");796796 ubi_dump_vid_hdr(vid_hdr);797797 dbg_msg("hexdump of PEB %d offset %d, length %d",798798 pnum, ubi->leb_start, ubi->leb_size);···907907 ubi->image_seq = image_seq;908908 if (ubi->image_seq && image_seq &&909909 ubi->image_seq != image_seq) {910910- ubi_err("bad image sequence number %d in PEB %d, "911911- "expected %d", image_seq, pnum, ubi->image_seq);910910+ ubi_err("bad image sequence number %d in PEB %d, expected %d",911911+ image_seq, pnum, ubi->image_seq);912912 ubi_dump_ec_hdr(ech);913913 return -EINVAL;914914 }···997997 /* Unsupported internal volume */998998 switch (vidh->compat) {999999 case UBI_COMPAT_DELETE:10001000- ubi_msg("\"delete\" compatible internal volume %d:%d"10011001- " found, will remove it", vol_id, lnum);10001000+ ubi_msg("\"delete\" compatible internal volume %d:%d found, will remove it",10011001+ vol_id, lnum);10021002 err = add_to_list(ai, pnum, vol_id, lnum,10031003 ec, 1, &ai->erase);10041004 if (err)···10061006 return 0;1007100710081008 case UBI_COMPAT_RO:10091009- ubi_msg("read-only compatible internal volume %d:%d"10101010- " found, switch to read-only mode",10091009+ ubi_msg("read-only compatible internal volume %d:%d found, switch to read-only mode",10111010 vol_id, lnum);10121011 ubi->ro_mode = 1;10131012 break;1014101310151014 case UBI_COMPAT_PRESERVE:10161016- ubi_msg("\"preserve\" compatible internal volume %d:%d"10171017- " found", vol_id, lnum);10151015+ ubi_msg("\"preserve\" compatible internal volume %d:%d found",10161016+ vol_id, lnum);10181017 err = add_to_list(ai, pnum, vol_id, lnum,10191018 ec, 0, &ai->alien);10201019 if (err)···11111112 get_random_bytes(&ubi->image_seq,11121113 sizeof(ubi->image_seq));11131114 } else {11141114- ubi_err("MTD device is not UBI-formatted and possibly "11151115- "contains non-UBI data - refusing it");11151115+ ubi_err("MTD device is not UBI-formatted and possibly contains non-UBI data - refusing it");11161116 return -EINVAL;11171117 }11181118
+10-12
drivers/mtd/ubi/build.c
···748748 * read-only mode.749749 */750750 if (ubi->vid_hdr_offset + UBI_VID_HDR_SIZE <= ubi->hdrs_min_io_size) {751751- ubi_warn("EC and VID headers are in the same minimal I/O unit, "752752- "switch to read-only mode");751751+ ubi_warn("EC and VID headers are in the same minimal I/O unit, switch to read-only mode");753752 ubi->ro_mode = 1;754753 }755754756755 ubi->leb_size = ubi->peb_size - ubi->leb_start;757756758757 if (!(ubi->mtd->flags & MTD_WRITEABLE)) {759759- ubi_msg("MTD device %d is write-protected, attach in "760760- "read-only mode", ubi->mtd->index);758758+ ubi_msg("MTD device %d is write-protected, attach in read-only mode",759759+ ubi->mtd->index);761760 ubi->ro_mode = 1;762761 }763762···891892 * no sense to attach emulated MTD devices, so we prohibit this.892893 */893894 if (mtd->type == MTD_UBIVOLUME) {894894- ubi_err("refuse attaching mtd%d - it is already emulated on "895895- "top of UBI", mtd->index);895895+ ubi_err("refuse attaching mtd%d - it is already emulated on top of UBI",896896+ mtd->index);896897 return -EINVAL;897898 }898899···1356135713571358 len = strnlen(val, MTD_PARAM_LEN_MAX);13581359 if (len == MTD_PARAM_LEN_MAX) {13591359- printk(KERN_ERR "UBI error: parameter \"%s\" is too long, "13601360- "max. is %d\n", val, MTD_PARAM_LEN_MAX);13601360+ printk(KERN_ERR "UBI error: parameter \"%s\" is too long, max. is %d\n",13611361+ val, MTD_PARAM_LEN_MAX);13611362 return -EINVAL;13621363 }1363136413641365 if (len == 0) {13651365- printk(KERN_WARNING "UBI warning: empty 'mtd=' parameter - "13661366- "ignored\n");13661366+ printk(KERN_WARNING "UBI warning: empty 'mtd=' parameter - ignored\n");13671367 return 0;13681368 }13691369···13941396 int err = kstrtoint(tokens[2], 10, &p->max_beb_per1024);1395139713961398 if (err) {13971397- printk(KERN_ERR "UBI error: bad value for "13981398- "max_beb_per1024 parameter: %s", tokens[2]);13991399+ printk(KERN_ERR "UBI error: bad value for max_beb_per1024 parameter: %s",14001400+ tokens[2]);13991401 return -EINVAL;14001402 }14011403 }
+5-4
drivers/mtd/ubi/cdev.c
···140140 vol->updating = 0;141141 vfree(vol->upd_buf);142142 } else if (vol->changing_leb) {143143- dbg_gen("only %lld of %lld bytes received for atomic LEB change"144144- " for volume %d:%d, cancel", vol->upd_received,145145- vol->upd_bytes, vol->ubi->ubi_num, vol->vol_id);143143+ dbg_gen("only %lld of %lld bytes received for atomic LEB change for volume %d:%d, cancel",144144+ vol->upd_received, vol->upd_bytes, vol->ubi->ubi_num,145145+ vol->vol_id);146146 vol->changing_leb = 0;147147 vfree(vol->upd_buf);148148 }···189189 return new_offset;190190}191191192192-static int vol_cdev_fsync(struct file *file, loff_t start, loff_t end, int datasync)192192+static int vol_cdev_fsync(struct file *file, loff_t start, loff_t end,193193+ int datasync)193194{194195 struct ubi_volume_desc *desc = file->private_data;195196 struct ubi_device *ubi = desc->vol->ubi;
···420420 */421421 if (err == UBI_IO_BAD_HDR_EBADMSG ||422422 err == UBI_IO_BAD_HDR) {423423- ubi_warn("corrupted VID header at PEB "424424- "%d, LEB %d:%d", pnum, vol_id,425425- lnum);423423+ ubi_warn("corrupted VID header at PEB %d, LEB %d:%d",424424+ pnum, vol_id, lnum);426425 err = -EBADMSG;427426 } else428427 ubi_ro_mode(ubi);···659660 if (len) {660661 err = ubi_io_write_data(ubi, buf, pnum, offset, len);661662 if (err) {662662- ubi_warn("failed to write %d bytes at offset %d of "663663- "LEB %d:%d, PEB %d", len, offset, vol_id,664664- lnum, pnum);663663+ ubi_warn("failed to write %d bytes at offset %d of LEB %d:%d, PEB %d",664664+ len, offset, vol_id, lnum, pnum);665665 goto write_error;666666 }667667 }···10381040 * cancel it.10391041 */10401042 if (vol->eba_tbl[lnum] != from) {10411041- dbg_wl("LEB %d:%d is no longer mapped to PEB %d, mapped to "10421042- "PEB %d, cancel", vol_id, lnum, from,10431043- vol->eba_tbl[lnum]);10431043+ dbg_wl("LEB %d:%d is no longer mapped to PEB %d, mapped to PEB %d, cancel",10441044+ vol_id, lnum, from, vol->eba_tbl[lnum]);10441045 err = MOVE_CANCEL_RACE;10451046 goto out_unlock_leb;10461047 }···11041107 err = ubi_io_read_vid_hdr(ubi, to, vid_hdr, 1);11051108 if (err) {11061109 if (err != UBI_IO_BITFLIPS) {11071107- ubi_warn("error %d while reading VID header back from "11081108- "PEB %d", err, to);11101110+ ubi_warn("error %d while reading VID header back from PEB %d",11111111+ err, to);11091112 if (is_error_sane(err))11101113 err = MOVE_TARGET_RD_ERR;11111114 } else···11311134 err = ubi_io_read_data(ubi, ubi->peb_buf, to, 0, aldata_size);11321135 if (err) {11331136 if (err != UBI_IO_BITFLIPS) {11341134- ubi_warn("error %d while reading data back "11351135- "from PEB %d", err, to);11371137+ ubi_warn("error %d while reading data back from PEB %d",11381138+ err, to);11361139 if (is_error_sane(err))11371140 err = MOVE_TARGET_RD_ERR;11381141 } else···11431146 cond_resched();1144114711451148 if (crc != crc32(UBI_CRC32_INIT, ubi->peb_buf, data_size)) {11461146- ubi_warn("read data back from PEB %d and it is "11471147- "different", to);11491149+ ubi_warn("read data back from PEB %d and it is different",11501150+ to);11481151 err = -EINVAL;11491152 goto out_unlock_buf;11501153 }···11941197 return;11951198 }1196119911971197- ubi_warn("cannot reserve enough PEBs for bad PEB handling, reserved %d,"11981198- " need %d", ubi->beb_rsvd_pebs, ubi->beb_rsvd_level);12001200+ ubi_warn("cannot reserve enough PEBs for bad PEB handling, reserved %d, need %d",12011201+ ubi->beb_rsvd_pebs, ubi->beb_rsvd_level);11991202 if (ubi->corr_peb_count)12001203 ubi_warn("%d PEBs are corrupted and not used",12011201- ubi->corr_peb_count);12041204+ ubi->corr_peb_count);12021205}1203120612041207/**
+13-15
drivers/mtd/ubi/gluebi.c
···341341 mutex_lock(&devices_mutex);342342 g = find_gluebi_nolock(vi->ubi_num, vi->vol_id);343343 if (g)344344- err_msg("gluebi MTD device %d form UBI device %d volume %d "345345- "already exists", g->mtd.index, vi->ubi_num,346346- vi->vol_id);344344+ err_msg("gluebi MTD device %d form UBI device %d volume %d already exists",345345+ g->mtd.index, vi->ubi_num, vi->vol_id);347346 mutex_unlock(&devices_mutex);348347349348 if (mtd_device_register(mtd, NULL, 0)) {···375376 mutex_lock(&devices_mutex);376377 gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id);377378 if (!gluebi) {378378- err_msg("got remove notification for unknown UBI device %d "379379- "volume %d", vi->ubi_num, vi->vol_id);379379+ err_msg("got remove notification for unknown UBI device %d volume %d",380380+ vi->ubi_num, vi->vol_id);380381 err = -ENOENT;381382 } else if (gluebi->refcnt)382383 err = -EBUSY;···389390 mtd = &gluebi->mtd;390391 err = mtd_device_unregister(mtd);391392 if (err) {392392- err_msg("cannot remove fake MTD device %d, UBI device %d, "393393- "volume %d, error %d", mtd->index, gluebi->ubi_num,394394- gluebi->vol_id, err);393393+ err_msg("cannot remove fake MTD device %d, UBI device %d, volume %d, error %d",394394+ mtd->index, gluebi->ubi_num, gluebi->vol_id, err);395395 mutex_lock(&devices_mutex);396396 list_add_tail(&gluebi->list, &gluebi_devices);397397 mutex_unlock(&devices_mutex);···420422 gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id);421423 if (!gluebi) {422424 mutex_unlock(&devices_mutex);423423- err_msg("got update notification for unknown UBI device %d "424424- "volume %d", vi->ubi_num, vi->vol_id);425425+ err_msg("got update notification for unknown UBI device %d volume %d",426426+ vi->ubi_num, vi->vol_id);425427 return -ENOENT;426428 }427429···447449 gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id);448450 if (!gluebi) {449451 mutex_unlock(&devices_mutex);450450- err_msg("got update notification for unknown UBI device %d "451451- "volume %d", vi->ubi_num, vi->vol_id);452452+ err_msg("got update notification for unknown UBI device %d volume %d",453453+ vi->ubi_num, vi->vol_id);452454 return -ENOENT;453455 }454456 gluebi->mtd.size = vi->used_bytes;···505507506508 err = mtd_device_unregister(mtd);507509 if (err)508508- err_msg("error %d while removing gluebi MTD device %d, "509509- "UBI device %d, volume %d - ignoring", err,510510- mtd->index, gluebi->ubi_num, gluebi->vol_id);510510+ err_msg("error %d while removing gluebi MTD device %d, UBI device %d, volume %d - ignoring",511511+ err, mtd->index, gluebi->ubi_num,512512+ gluebi->vol_id);511513 kfree(mtd->name);512514 kfree(gluebi);513515 }
+38-40
drivers/mtd/ubi/io.c
···183183 }184184185185 if (retries++ < UBI_IO_RETRIES) {186186- ubi_warn("error %d%s while reading %d bytes from PEB "187187- "%d:%d, read only %zd bytes, retry",186186+ ubi_warn("error %d%s while reading %d bytes from PEB %d:%d, read only %zd bytes, retry",188187 err, errstr, len, pnum, offset, read);189188 yield();190189 goto retry;191190 }192191193193- ubi_err("error %d%s while reading %d bytes from PEB %d:%d, "194194- "read %zd bytes", err, errstr, len, pnum, offset, read);192192+ ubi_err("error %d%s while reading %d bytes from PEB %d:%d, read %zd bytes",193193+ err, errstr, len, pnum, offset, read);195194 dump_stack();196195197196 /*···273274 }274275275276 if (ubi_dbg_is_write_failure(ubi)) {276276- ubi_err("cannot write %d bytes to PEB %d:%d "277277- "(emulated)", len, pnum, offset);277277+ ubi_err("cannot write %d bytes to PEB %d:%d (emulated)",278278+ len, pnum, offset);278279 dump_stack();279280 return -EIO;280281 }···282283 addr = (loff_t)pnum * ubi->peb_size + offset;283284 err = mtd_write(ubi->mtd, addr, len, &written, buf);284285 if (err) {285285- ubi_err("error %d while writing %d bytes to PEB %d:%d, written "286286- "%zd bytes", err, len, pnum, offset, written);286286+ ubi_err("error %d while writing %d bytes to PEB %d:%d, written %zd bytes",287287+ err, len, pnum, offset, written);287288 dump_stack();288289 ubi_dump_flash(ubi, pnum, offset, len);289290 } else···684685 leb_start = be32_to_cpu(ec_hdr->data_offset);685686686687 if (ec_hdr->version != UBI_VERSION) {687687- ubi_err("node with incompatible UBI version found: "688688- "this UBI version is %d, image version is %d",688688+ ubi_err("node with incompatible UBI version found: this UBI version is %d, image version is %d",689689 UBI_VERSION, (int)ec_hdr->version);690690 goto bad;691691 }···775777 if (ubi_check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) {776778 /* The physical eraseblock is supposedly empty */777779 if (verbose)778778- ubi_warn("no EC header found at PEB %d, "779779- "only 0xFF bytes", pnum);780780- dbg_bld("no EC header found at PEB %d, "781781- "only 0xFF bytes", pnum);780780+ ubi_warn("no EC header found at PEB %d, only 0xFF bytes",781781+ pnum);782782+ dbg_bld("no EC header found at PEB %d, only 0xFF bytes",783783+ pnum);782784 if (!read_err)783785 return UBI_IO_FF;784786 else···790792 * 0xFF bytes. Report that the header is corrupted.791793 */792794 if (verbose) {793793- ubi_warn("bad magic number at PEB %d: %08x instead of "794794- "%08x", pnum, magic, UBI_EC_HDR_MAGIC);795795+ ubi_warn("bad magic number at PEB %d: %08x instead of %08x",796796+ pnum, magic, UBI_EC_HDR_MAGIC);795797 ubi_dump_ec_hdr(ec_hdr);796798 }797797- dbg_bld("bad magic number at PEB %d: %08x instead of "798798- "%08x", pnum, magic, UBI_EC_HDR_MAGIC);799799+ dbg_bld("bad magic number at PEB %d: %08x instead of %08x",800800+ pnum, magic, UBI_EC_HDR_MAGIC);799801 return UBI_IO_BAD_HDR;800802 }801803···804806805807 if (hdr_crc != crc) {806808 if (verbose) {807807- ubi_warn("bad EC header CRC at PEB %d, calculated "808808- "%#08x, read %#08x", pnum, crc, hdr_crc);809809+ ubi_warn("bad EC header CRC at PEB %d, calculated %#08x, read %#08x",810810+ pnum, crc, hdr_crc);809811 ubi_dump_ec_hdr(ec_hdr);810812 }811811- dbg_bld("bad EC header CRC at PEB %d, calculated "812812- "%#08x, read %#08x", pnum, crc, hdr_crc);813813+ dbg_bld("bad EC header CRC at PEB %d, calculated %#08x, read %#08x",814814+ pnum, crc, hdr_crc);813815814816 if (!read_err)815817 return UBI_IO_BAD_HDR;···1030103210311033 if (ubi_check_pattern(vid_hdr, 0xFF, UBI_VID_HDR_SIZE)) {10321034 if (verbose)10331033- ubi_warn("no VID header found at PEB %d, "10341034- "only 0xFF bytes", pnum);10351035- dbg_bld("no VID header found at PEB %d, "10361036- "only 0xFF bytes", pnum);10351035+ ubi_warn("no VID header found at PEB %d, only 0xFF bytes",10361036+ pnum);10371037+ dbg_bld("no VID header found at PEB %d, only 0xFF bytes",10381038+ pnum);10371039 if (!read_err)10381040 return UBI_IO_FF;10391041 else···10411043 }1042104410431045 if (verbose) {10441044- ubi_warn("bad magic number at PEB %d: %08x instead of "10451045- "%08x", pnum, magic, UBI_VID_HDR_MAGIC);10461046+ ubi_warn("bad magic number at PEB %d: %08x instead of %08x",10471047+ pnum, magic, UBI_VID_HDR_MAGIC);10461048 ubi_dump_vid_hdr(vid_hdr);10471049 }10481048- dbg_bld("bad magic number at PEB %d: %08x instead of "10491049- "%08x", pnum, magic, UBI_VID_HDR_MAGIC);10501050+ dbg_bld("bad magic number at PEB %d: %08x instead of %08x",10511051+ pnum, magic, UBI_VID_HDR_MAGIC);10501052 return UBI_IO_BAD_HDR;10511053 }10521054···1055105710561058 if (hdr_crc != crc) {10571059 if (verbose) {10581058- ubi_warn("bad CRC at PEB %d, calculated %#08x, "10591059- "read %#08x", pnum, crc, hdr_crc);10601060+ ubi_warn("bad CRC at PEB %d, calculated %#08x, read %#08x",10611061+ pnum, crc, hdr_crc);10601062 ubi_dump_vid_hdr(vid_hdr);10611063 }10621062- dbg_bld("bad CRC at PEB %d, calculated %#08x, "10631063- "read %#08x", pnum, crc, hdr_crc);10641064+ dbg_bld("bad CRC at PEB %d, calculated %#08x, read %#08x",10651065+ pnum, crc, hdr_crc);10641066 if (!read_err)10651067 return UBI_IO_BAD_HDR;10661068 else···12981300 crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_EC_HDR_SIZE_CRC);12991301 hdr_crc = be32_to_cpu(vid_hdr->hdr_crc);13001302 if (hdr_crc != crc) {13011301- ubi_err("bad VID header CRC at PEB %d, calculated %#08x, "13021302- "read %#08x", pnum, crc, hdr_crc);13031303+ ubi_err("bad VID header CRC at PEB %d, calculated %#08x, read %#08x",13041304+ pnum, crc, hdr_crc);13031305 ubi_err("self-check failed for PEB %d", pnum);13041306 ubi_dump_vid_hdr(vid_hdr);13051307 dump_stack();···1409141114101412 err = mtd_read(ubi->mtd, addr, len, &read, buf);14111413 if (err && !mtd_is_bitflip(err)) {14121412- ubi_err("error %d while reading %d bytes from PEB %d:%d, "14131413- "read %zd bytes", err, len, pnum, offset, read);14141414+ ubi_err("error %d while reading %d bytes from PEB %d:%d, read %zd bytes",14151415+ err, len, pnum, offset, read);14141416 goto error;14151417 }1416141814171419 err = ubi_check_pattern(buf, 0xFF, len);14181420 if (err == 0) {14191419- ubi_err("flash region at PEB %d:%d, length %d does not "14201420- "contain all 0xFF bytes", pnum, offset, len);14211421+ ubi_err("flash region at PEB %d:%d, length %d does not contain all 0xFF bytes",14221422+ pnum, offset, len);14211423 goto fail;14221424 }14231425
+1-3
drivers/mtd/ubi/misc.c
···128128 ubi->beb_rsvd_level = ubi->bad_peb_limit - ubi->bad_peb_count;129129 if (ubi->beb_rsvd_level < 0) {130130 ubi->beb_rsvd_level = 0;131131- ubi_warn("number of bad PEBs (%d) is above the expected limit "132132- "(%d), not reserving any PEBs for bad PEB handling, "133133- "will use available PEBs (if any)",131131+ 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)",134132 ubi->bad_peb_count, ubi->bad_peb_limit);135133 }136134}
+4-4
drivers/mtd/ubi/vtbl.c
···270270271271 if (len1 > 0 && len1 == len2 &&272272 !strncmp(vtbl[i].name, vtbl[n].name, len1)) {273273- ubi_err("volumes %d and %d have the same name"274274- " \"%s\"", i, n, vtbl[i].name);273273+ ubi_err("volumes %d and %d have the same name \"%s\"",274274+ i, n, vtbl[i].name);275275 ubi_dump_vtbl_record(&vtbl[i], i);276276 ubi_dump_vtbl_record(&vtbl[n], n);277277 return -EINVAL;···562562 if (vtbl[i].flags & UBI_VTBL_AUTORESIZE_FLG) {563563 /* Auto re-size flag may be set only for one volume */564564 if (ubi->autoresize_vol_id != -1) {565565- ubi_err("more than one auto-resize volume (%d "566566- "and %d)", ubi->autoresize_vol_id, i);565565+ ubi_err("more than one auto-resize volume (%d and %d)",566566+ ubi->autoresize_vol_id, i);567567 kfree(vol);568568 return -EINVAL;569569 }