From: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
To: Peter Korsgaard <jacmet@sunsite.dk>
Cc: linuxppc-dev@ozlabs.org, David.Woodhouse@intel.com,
linuxppc-embedded@ozlabs.org
Subject: Re: [MTD] ofpart: Partitions at same address cannot have the same name
Date: Wed, 22 Apr 2009 17:34:29 +0200 [thread overview]
Message-ID: <aa76a2be0904220834x48fe3d97i1086595f1fd63701@mail.gmail.com> (raw)
In-Reply-To: <874owhoxce.fsf@macbook.be.48ers.dk>
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@sunsite.dk> wrote:
>>>>>> "Ricardo" =3D=3D Ricardo Ribalda Delgado <ricardo.ribalda@uam.es> wr=
ites:
>
> Hi,
>
> =A0Ricardo> Sometimes, an special partition is included in the device
> =A0Ricardo> tree including all the partitions. Like in:
>
> =A0Ricardo> =A0drivers/mtd/ofpart.c | =A0 =A03 ++-
> =A0Ricardo> =A01 files changed, 2 insertions(+), 1 deletions(-)
>
> =A0Ricardo> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
> =A0Ricardo> index 3e164f0..0af3b07 100644
> =A0Ricardo> --- a/drivers/mtd/ofpart.c
> =A0Ricardo> +++ b/drivers/mtd/ofpart.c
> =A0Ricardo> @@ -48,7 +48,8 @@ int __devinit of_mtd_parse_partitions(struc=
t device *dev,
>
> =A0Ricardo> =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* check if this is a partition n=
ode */
> =A0Ricardo> =A0 =A0 =A0 =A0 =A0 =A0 =A0 partname =3D of_get_property(pp, =
"name", &len);
> =A0Ricardo> - =A0 =A0 =A0 =A0 =A0 =A0 if (strcmp(partname, "partition") !=
=3D 0) {
> =A0Ricardo> + =A0 =A0 =A0 =A0 =A0 =A0 if (strncmp(partname, "partition", =
strlen("partition")-1)
>
> Why strlen() - 1 ?
>
> --
> Bye, Peter Korsgaard
>
--=20
Ricardo Ribalda
http://www.eps.uam.es/~rribalda/
next prev parent reply other threads:[~2009-04-22 15:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-22 8:05 [MTD] ofpart: Partitions at same address cannot have the same name Ricardo Ribalda Delgado
2009-04-22 9:24 ` Peter Korsgaard
2009-04-22 15:34 ` Ricardo Ribalda Delgado [this message]
2009-04-22 15:52 ` Ricardo Ribalda Delgado
2009-04-22 17:10 ` Benjamin Krill
2009-04-22 17:27 ` Scott Wood
2009-04-22 17:56 ` Ricardo Ribalda Delgado
2009-04-22 18:11 ` Scott Wood
2009-04-22 18:58 ` Ricardo Ribalda Delgado
2009-04-22 17:59 ` Ricardo Ribalda Delgado
2009-04-22 18:33 ` Benjamin Krill
2009-04-30 3:19 ` [MTD] " Benjamin Herrenschmidt
2009-04-30 5:32 ` David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa76a2be0904220834x48fe3d97i1086595f1fd63701@mail.gmail.com \
--to=ricardo.ribalda@uam.es \
--cc=David.Woodhouse@intel.com \
--cc=jacmet@sunsite.dk \
--cc=linuxppc-dev@ozlabs.org \
--cc=linuxppc-embedded@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).