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

2012-09-03 Thread Artem Bityutskiy
On Sun, 2012-08-26 at 13:21 -0400, Huang Shijie wrote: > +/* There are only several partitions, so the Bubble sort is enough. */ > +static inline void sort_partitons(struct mtd_partition *parts, int num_parts) > +{ > + int i, j; > + > + if (num_parts < 2) > + return; Not necess

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

2012-08-31 Thread Huang Shijie
On Fri, Aug 31, 2012 at 9:59 AM, Artem Bityutskiy wrote: > 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@200m(rootfs),100m@0(boot),100m@100m(kernel) >> >> But the current

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

2012-08-31 Thread Artem Bityutskiy
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@200m(rootfs),100m@0(boot),100m@100m(kernel) > > But the current code can not parse out any partition with this > cmdline. > > T

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

2012-08-25 Thread Huang Shijie
Assume we have a 1GB(8Gb) nand chip. It is legit if we set the partitions as the following: gpmi-nand:1g@200m(rootfs),100m@0(boot),100m@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 m