[MTD] ofpart: Partitions at same address cannot have the same name
Ricardo Ribalda Delgado
ricardo.ribalda at uam.es
Thu Apr 23 01:34:29 EST 2009
Hello
You are right, remove the -1. I thought that strlen gives the #of
chars + 1 ('\0').
Thanks
On Wed, Apr 22, 2009 at 11:24, Peter Korsgaard <jacmet at sunsite.dk> wrote:
>>>>>> "Ricardo" == Ricardo Ribalda Delgado <ricardo.ribalda at uam.es> writes:
>
> Hi,
>
> Ricardo> Sometimes, an special partition is included in the device
> Ricardo> tree including all the partitions. Like in:
>
> Ricardo> drivers/mtd/ofpart.c | 3 ++-
> Ricardo> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> Ricardo> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
> Ricardo> index 3e164f0..0af3b07 100644
> Ricardo> --- a/drivers/mtd/ofpart.c
> Ricardo> +++ b/drivers/mtd/ofpart.c
> Ricardo> @@ -48,7 +48,8 @@ int __devinit of_mtd_parse_partitions(struct device *dev,
>
> Ricardo> /* check if this is a partition node */
> Ricardo> partname = of_get_property(pp, "name", &len);
> Ricardo> - if (strcmp(partname, "partition") != 0) {
> Ricardo> + if (strncmp(partname, "partition", strlen("partition")-1)
>
> Why strlen() - 1 ?
>
> --
> Bye, Peter Korsgaard
>
--
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/
More information about the Linuxppc-dev
mailing list