Re: ofpart: Partitions at same address cannot have the same name

2009-04-22 Thread Benjamin Krill
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -48,7 +48,7 @@ int __devinit of_mtd_parse_partitions(struct device *dev,
 
   /* check if this is a partition node */
   partname = of_get_property(pp, name, len);
-  if (strcmp(partname, partition) != 0) {
+  if (strncmp(partname, partition, strlen(partition) != 0) {

Hi Recardo,

I would suggest to do:

if (strcmp(partname, partition) = 0) {

cheers
 ben

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ofpart: Partitions at same address cannot have the same name

2009-04-22 Thread Scott Wood

Benjamin Krill wrote:

--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -48,7 +48,7 @@ int __devinit of_mtd_parse_partitions(struct device *dev,

/* check if this is a partition node */
partname = of_get_property(pp, name, len);
-   if (strcmp(partname, partition) != 0) {
+   if (strncmp(partname, partition, strlen(partition) != 0) {


Perhaps compatible should be used instead?


Hi Recardo,

I would suggest to do:

if (strcmp(partname, partition) = 0) {


Check whether it sorts alphabetically before partition?  Why?

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ofpart: Partitions at same address cannot have the same name

2009-04-22 Thread Ricardo Ribalda Delgado
Hi Scott

 Perhaps compatible should be used instead?

What do you mean?

if (strcmp(partname, partition) || strcmp(partname, compatible) )

I can't see the advantages.



 Hi Recardo,

 I would suggest to do:

                if (strcmp(partname, partition) = 0) {

 Check whether it sorts alphabetically before partition?  Why?

 -Scott




-- 
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ofpart: Partitions at same address cannot have the same name

2009-04-22 Thread Ricardo Ribalda Delgado
Hello Benjamin

 Hi Recardo,

 I would suggest to do:

                if (strcmp(partname, partition) = 0) {

Anything alfabetically higher than partition (like z will pass
the test :S)

Regards




 cheers
  ben





-- 
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ofpart: Partitions at same address cannot have the same name

2009-04-22 Thread Scott Wood

Ricardo Ribalda Delgado wrote:

Hi Scott


Perhaps compatible should be used instead?


What do you mean?

if (strcmp(partname, partition) || strcmp(partname, compatible) )

I can't see the advantages.


No, I mean:

foo {
compatible = partition;
...
};

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: ofpart: Partitions at same address cannot have the same name

2009-04-22 Thread Benjamin Krill
* Ricardo Ribalda Delgado | 2009-04-22 19:59:08 [+0200]:

                if (strcmp(partname, partition) = 0) {

Anything alfabetically higher than partition (like z will pass
the test :S)

You are totally right!

cheers
 ben
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev