linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: cmdlinepart: allow small partitions
@ 2015-06-19 20:10 Brian Norris
  2015-06-19 20:10 ` [PATCH 2/2] mtd: cmdlinepart: convert printk() to pr_*() Brian Norris
  2015-09-29  1:39 ` [PATCH 1/2] mtd: cmdlinepart: allow small partitions Brian Norris
  0 siblings, 2 replies; 3+ messages in thread
From: Brian Norris @ 2015-06-19 20:10 UTC (permalink / raw)
  To: linux-mtd; +Cc: Brian Norris

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 <computersforpeace@gmail.com>
---
Anyone know a good reason why this restriction should be here?

 drivers/mtd/cmdlinepart.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

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);
 		}
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-29  1:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-19 20:10 [PATCH 1/2] mtd: cmdlinepart: allow small partitions Brian Norris
2015-06-19 20:10 ` [PATCH 2/2] mtd: cmdlinepart: convert printk() to pr_*() Brian Norris
2015-09-29  1:39 ` [PATCH 1/2] mtd: cmdlinepart: allow small partitions Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).