linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 10/61] bootwrapper: flatdevtree fixes
@ 2007-07-18 15:43 Milton Miller
  2007-07-18 18:56 ` Scott Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Milton Miller @ 2007-07-18 15:43 UTC (permalink / raw)
  To: Scott Wood; +Cc: ppcdev, Paul Mackerras, David Gibson

In-Reply-To: <20070718013137.GA15217@ld0162-tx32.am.freescale.net>

On Wed Jul 18 11:33:08 EST 2007, Scott Wood wrote:
> 1. ft_create_node was returning the internal pointer rather than a 
> phandle.
> 2. ft_find_device_rel was treating lookups relative to root as an 
> error.

No, it is treating lookups relative to NULL as an error.

Your patch changes it to treat lookups relative to the NULL phandle as 
relative to root.

I've no objections to the other part, can you split these?

>
> Signed-off-by: Scott Wood <scottwood at freescale.com>
> ---
>  arch/powerpc/boot/flatdevtree.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/boot/flatdevtree.c 
> b/arch/powerpc/boot/flatdevtree.c
> index b732644..5b69aeb 100644
> --- a/arch/powerpc/boot/flatdevtree.c
> +++ b/arch/powerpc/boot/flatdevtree.c
> @@ -659,9 +659,13 @@ void *ft_find_device_rel(struct ft_cxt *cxt, 
> const void *top,
>  {
>         char *node;
>
> -       node = ft_node_ph2node(cxt, top);
> -       if (node == NULL)
> -               return NULL;
> +       if (top) {
> +               node = ft_node_ph2node(cxt, top);
> +               if (node == NULL)
> +                       return NULL;
> +       } else {
> +               node = ft_root_node(cxt);
> +       }
>

milton

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH 01/61] Use strcasecmp() rather than strncasecmp() when determining device node compatibility.
@ 2007-07-18  1:31 Scott Wood
  2007-07-18  1:33 ` [PATCH 10/61] bootwrapper: flatdevtree fixes Scott Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2007-07-18  1:31 UTC (permalink / raw)
  To: linuxppc-dev

The current code assumes "foo-bar" must always be compatible with a node
compatible with "foo", which breaks device trees where this is not so.

The "case" part is also wrong according to Open Firmware, but it's more
likely to have drivers and/or device trees depending on it, and thus
needs to be handled more carefully.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/kernel/prom.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 37ff99b..0b136a5 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -218,7 +218,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 (strcasecmp(cp, compat) == 0)
 			return 1;
 		l = strlen(cp) + 1;
 		cp += l;
@@ -1099,7 +1099,7 @@ int of_device_is_compatible(const struct device_node *device,
 	if (cp == NULL)
 		return 0;
 	while (cplen > 0) {
-		if (strncasecmp(cp, compat, strlen(compat)) == 0)
+		if (strcasecmp(cp, compat) == 0)
 			return 1;
 		l = strlen(cp) + 1;
 		cp += l;
-- 
1.5.0.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-19  5:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-18 15:43 [PATCH 10/61] bootwrapper: flatdevtree fixes Milton Miller
2007-07-18 18:56 ` Scott Wood
2007-07-19  5:45   ` Milton Miller
  -- strict thread matches above, loose matches on Subject: below --
2007-07-18  1:31 [PATCH 01/61] Use strcasecmp() rather than strncasecmp() when determining device node compatibility Scott Wood
2007-07-18  1:33 ` [PATCH 10/61] bootwrapper: flatdevtree fixes Scott Wood
2007-07-18 16:20   ` Milton Miller

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).