aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-06-14 08:15:39 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-06-14 08:47:49 +0300
commitf5d5b1f8c12a7637ee1145f2f00358eb375edb54 (patch)
tree5d4b5ec5ef6eba5fb0f5cc1e5127115da33c2759 /drivers/mtd/ubi
parent095751a6e0838a712393a74eb0b7b6559dbdbe81 (diff)
downloadkernel_samsung_tuna-f5d5b1f8c12a7637ee1145f2f00358eb375edb54.zip
kernel_samsung_tuna-f5d5b1f8c12a7637ee1145f2f00358eb375edb54.tar.gz
kernel_samsung_tuna-f5d5b1f8c12a7637ee1145f2f00358eb375edb54.tar.bz2
UBI: fix error message and compilation warnings
Fix the followong compilation warnings introduced by commit 095751a6e0838a712393a74eb0b7b6559dbdbe81: drivers/mtd/ubi/scan.c: In function 'check_what_we_have': drivers/mtd/ubi/scan.c:960: warning: passing argument 1 of 'get_random_bytes' discards qualifiers from pointer target type Fix the following compilation warnings introduced by commit 1a49af2ca019dcb4614c32f832bbcb814b61409c: drivers/mtd/ubi/io.c: In function 'ubi_io_read': drivers/mtd/ubi/io.c:153: warning: initialization makes integer from pointer without a cast drivers/mtd/ubi/io.c:170: warning: format '%s' expects type 'char *', but argument 5 has type 'int' drivers/mtd/ubi/io.c:177: warning: format '%zd' expects type 'signed size_t', but argument 7 has type 'int' drivers/mtd/ubi/io.c:177: warning: too many arguments for format Also, amend the ECC error code string and add brackets and whitespace there - this should make the message readable. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r--drivers/mtd/ubi/io.c4
-rw-r--r--drivers/mtd/ubi/scan.c3
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index ffb2303..332f992 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -150,7 +150,7 @@ int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
retry:
err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf);
if (err) {
- const char errstr = (err == -EBADMSG) ? "ECC error" : "";
+ const char *errstr = (err == -EBADMSG) ? " (ECC error)" : "";
if (err == -EUCLEAN) {
/*
@@ -174,7 +174,7 @@ retry:
goto retry;
}
- ubi_err("error %d while reading %d bytes from PEB %d:%d, "
+ ubi_err("error %d%s while reading %d bytes from PEB %d:%d, "
"read %zd bytes", err, errstr, len, pnum, offset, read);
ubi_dbg_dump_stack();
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index de7b2f1..37855e5 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -901,8 +901,7 @@ adjust_mean_ec:
* MTD device. Returns zero if we should proceed with attaching the MTD device,
* and %-EINVAL if we should not.
*/
-static int check_what_we_have(const struct ubi_device *ubi,
- struct ubi_scan_info *si)
+static int check_what_we_have(struct ubi_device *ubi, struct ubi_scan_info *si)
{
struct ubi_scan_leb *seb;
int max_corr;