[PATCH 2/3] mtd: cmdlinepart: sort the unsorted partitions

Artem Bityutskiy dedekind1 at gmail.com
Fri Aug 31 09:59:18 EDT 2012


On Sun, 2012-08-26 at 13:21 -0400, Huang Shijie wrote:
> Assume we have a 1GB(8Gb) nand chip.
> It is legit if we set the partitions as the following:
>     gpmi-nand:1g at 200m(rootfs),100m at 0(boot),100m at 100m(kernel)
> 
> But the current code can not parse out any partition with this
> cmdline.
> 
> This patch sorts the unsorted partitions by the @offset.
> For there are maybe only several partitions, i use the simple
> Bubble sort algorithm.
> 
> Signed-off-by: Huang Shijie <shijie8 at gmail.com>

I still cannot find time to actually think about this carefully, but the
commit message does not sound convincing, it does not explain why
sorting is the right way to fix the issue, and what would be the
alternatives. It actually also does not explain why exactly we currently
cannot parse the example string.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120831/c3ea733d/attachment.sig>


More information about the linux-mtd mailing list