From: Brian Norris Date: Fri, 19 Jun 2015 20:10:06 +0000 (-0700) Subject: mtd: cmdlinepart: allow small partitions X-Git-Tag: v6.6-pxa1908~20144^2~143 X-Git-Url: https://git.dujemihanovic.xyz/?a=commitdiff_plain;h=d855d23b56a5d67a7727dc275a86aaba290d7c55;p=linux.git mtd: cmdlinepart: allow small partitions I'm not sure why we have a PAGE_SIZE restriction on this partition parser. If we really wanted the restriction, I would expect it to be a restriction for *all* parsers, so we'd move it to the MTD core At any rate, while small partitions may not be useful (they'll often be smaller than the eraseblock size and therefore can only be used read-only), they still have use as a read-only partition. This restriction is especially annoying because it aborts the entire MTD's cmdline parsing, leaving it unpartitioned. So, let's kill the restriction and only check for zero-sized partitions, which I expect we don't want to allow. Signed-off-by: Brian Norris --- diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c index c8503006f17a..477923a8b86f 100644 --- a/drivers/mtd/cmdlinepart.c +++ b/drivers/mtd/cmdlinepart.c @@ -115,9 +115,8 @@ static struct mtd_partition * newpart(char *s, s++; } else { size = memparse(s, &s); - if (size < PAGE_SIZE) { - printk(KERN_ERR ERRP "partition size too small (%llx)\n", - size); + if (!size) { + printk(KERN_ERR ERRP "partition has size 0\n"); return ERR_PTR(-EINVAL); } }