projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'torvalds/master'
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
mtd
/
cmdlinepart.c
diff --git
a/drivers/mtd/cmdlinepart.c
b/drivers/mtd/cmdlinepart.c
index c8503006f17aaf63714cdd98f5e8fe9c80da8c78..08f62987cc37c4f02e7bf359806c802d9a601119 100644
(file)
--- a/
drivers/mtd/cmdlinepart.c
+++ b/
drivers/mtd/cmdlinepart.c
@@
-48,6
+48,8
@@
* edb7312-nor:256k(ARMboot)ro,-(root);edb7312-nand:-(home)
*/
* edb7312-nor:256k(ARMboot)ro,-(root);edb7312-nand:-(home)
*/
+#define pr_fmt(fmt) "mtd: " fmt
+
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/mtd/mtd.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/mtd/mtd.h>
@@
-55,9
+57,6
@@
#include <linux/module.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/err.h>
-/* error message prefix */
-#define ERRP "mtd: "
-
/* debug macro */
#if 0
#define dbg(x) do { printk("DEBUG-CMDLINE-PART: "); printk x; } while(0)
/* debug macro */
#if 0
#define dbg(x) do { printk("DEBUG-CMDLINE-PART: "); printk x; } while(0)
@@
-115,9
+114,8
@@
static struct mtd_partition * newpart(char *s,
s++;
} else {
size = memparse(s, &s);
s++;
} else {
size = memparse(s, &s);
- if (size < PAGE_SIZE) {
- printk(KERN_ERR ERRP "partition size too small (%llx)\n",
- size);
+ if (!size) {
+ pr_err("partition has size 0\n");
return ERR_PTR(-EINVAL);
}
}
return ERR_PTR(-EINVAL);
}
}
@@
-142,7
+140,7
@@
static struct mtd_partition * newpart(char *s,
name = ++s;
p = strchr(name, delim);
if (!p) {
name = ++s;
p = strchr(name, delim);
if (!p) {
- pr
intk(KERN_ERR ERRP
"no closing %c found in partition name\n", delim);
+ pr
_err(
"no closing %c found in partition name\n", delim);
return ERR_PTR(-EINVAL);
}
name_len = p - name;
return ERR_PTR(-EINVAL);
}
name_len = p - name;
@@
-170,7
+168,7
@@
static struct mtd_partition * newpart(char *s,
/* test if more partitions are following */
if (*s == ',') {
if (size == SIZE_REMAINING) {
/* test if more partitions are following */
if (*s == ',') {
if (size == SIZE_REMAINING) {
- pr
intk(KERN_ERR ERRP
"no partitions allowed after a fill-up partition\n");
+ pr
_err(
"no partitions allowed after a fill-up partition\n");
return ERR_PTR(-EINVAL);
}
/* more partitions follow, parse them */
return ERR_PTR(-EINVAL);
}
/* more partitions follow, parse them */
@@
-237,7
+235,7
@@
static int mtdpart_setup_real(char *s)
/* fetch <mtd-id> */
p = strchr(s, ':');
if (!p) {
/* fetch <mtd-id> */
p = strchr(s, ':');
if (!p) {
- pr
intk(KERN_ERR ERRP
"no mtd-id\n");
+ pr
_err(
"no mtd-id\n");
return -EINVAL;
}
mtd_id_len = p - mtd_id;
return -EINVAL;
}
mtd_id_len = p - mtd_id;
@@
-289,7
+287,7
@@
static int mtdpart_setup_real(char *s)
/* does another spec follow? */
if (*s != ';') {
/* does another spec follow? */
if (*s != ';') {
- pr
intk(KERN_ERR ERRP
"bad character after partition (%c)\n", *s);
+ pr
_err(
"bad character after partition (%c)\n", *s);
return -EINVAL;
}
s++;
return -EINVAL;
}
s++;
@@
-343,17
+341,15
@@
static int parse_cmdline_partitions(struct mtd_info *master,
part->parts[i].size = master->size - offset;
if (offset + part->parts[i].size > master->size) {
part->parts[i].size = master->size - offset;
if (offset + part->parts[i].size > master->size) {
- printk(KERN_WARNING ERRP
- "%s: partitioning exceeds flash size, truncating\n",
- part->mtd_id);
+ pr_warn("%s: partitioning exceeds flash size, truncating\n",
+ part->mtd_id);
part->parts[i].size = master->size - offset;
}
offset += part->parts[i].size;
if (part->parts[i].size == 0) {
part->parts[i].size = master->size - offset;
}
offset += part->parts[i].size;
if (part->parts[i].size == 0) {
- printk(KERN_WARNING ERRP
- "%s: skipping zero sized partition\n",
- part->mtd_id);
+ pr_warn("%s: skipping zero sized partition\n",
+ part->mtd_id);
part->num_parts--;
memmove(&part->parts[i], &part->parts[i + 1],
sizeof(*part->parts) * (part->num_parts - i));
part->num_parts--;
memmove(&part->parts[i], &part->parts[i + 1],
sizeof(*part->parts) * (part->num_parts - i));