From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Stuart Yoder <stuart.yoder@freescale.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] fix of_flat_dt_is_compatible to match the full compatible string
Date: Fri, 23 Jul 2010 12:45:50 +1000 [thread overview]
Message-ID: <1279853150.1970.58.camel@pasglop> (raw)
In-Reply-To: <1279841330-28695-1-git-send-email-stuart.yoder@freescale.com>
On Thu, 2010-07-22 at 18:28 -0500, Stuart Yoder wrote:
> From: Stuart Yoder <stuart.yoder@freescale.com>
>
> With the previous string comparison, a device tree
> compatible of "foo-bar" would match as compatible
> with a driver looking for "foo".
>
> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Beware you are doing two changes in one here and only documenting one...
You also removed the case insenstivity.
Now, those things are supposed to be case sensitive afaik, but we have
enough legacy HW with more/less crap DTs and I'd be careful with
changing that without a good reason (ie, it breaks not to do it ?).
No objection with fixing the partial match tho.
Cheers,
Ben.
> ---
> drivers/of/fdt.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index dee4fb5..f5239c0 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -169,7 +169,7 @@ int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
> if (cp == NULL)
> return 0;
> while (cplen > 0) {
> - if (strncasecmp(cp, compat, strlen(compat)) == 0)
> + if (!strcmp(cp, compat))
> return 1;
> l = strlen(cp) + 1;
> cp += l;
next prev parent reply other threads:[~2010-07-23 2:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-22 23:28 [PATCH] fix of_flat_dt_is_compatible to match the full compatible string Stuart Yoder
2010-07-23 2:45 ` Benjamin Herrenschmidt [this message]
2010-07-24 22:00 ` Grant Likely
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=1279853150.1970.58.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=stuart.yoder@freescale.com \
/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).