WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

Re: [XenPPC] Fixed bug in ofd find by property

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [XenPPC] Fixed bug in ofd find by property
From: Maria Butrico <butrico@xxxxxxxxxxxxx>
Date: Mon, 20 Mar 2006 16:18:45 -0500
Delivery-date: Mon, 20 Mar 2006 21:20:17 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E1FLQgA-0005DA-IF@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E1FLQgA-0005DA-IF@xxxxxxxxxxxxxxxxxxxxx>
Reply-to: butrico@xxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5 (Windows/20051201)
Please note that I am currently chasing another bug in this space and that this patch might make the other bug more likely to occur. The other bug is that during fixup of the ofd tree, we do not find the target node for a fixup.

Maria Butrico wrote:
Signed-off-by: Maria Butrico <butrico@xxxxxxxxxxxxxx>

summary:     Fixed bug in ofd find by property.
Bug was that find by property established a partial next/prev list,
with only one element, so that use of this function in ofd fixup code
could not fixup all the nodes that needed to be fixed.

diff -r 76805cb82965 xen/arch/ppc/of-devtree.c
--- a/xen/arch/ppc/of-devtree.c Wed Mar 15 13:19:41 2006 -0600
+++ b/xen/arch/ppc/of-devtree.c Mon Mar 20 14:56:50 2006 -0500
@@ -865,7 +865,7 @@ static ofdn_t ofd_find_by_prop(
 static ofdn_t ofd_find_by_prop(
     struct ofd_mem *m,
     ofdn_t head,
-    ofdn_t prev,
+    ofdn_t *prev_p,
     ofdn_t n,
     const char *name,
     const void *val,
@@ -893,22 +893,22 @@ retry:
             }
         }
         if ( match == 1 ) {
-            if ( prev >= 0 ) {
-                np = ofd_node_get(m, prev);
+            if ( *prev_p >= 0 ) {
+                np = ofd_node_get(m, *prev_p);
                 np->on_next = n;
             } else {
                 head = n;
             }
             np = ofd_node_get(m, n);
-            np->on_prev = prev;
+            np->on_prev = *prev_p;
             np->on_next = -1;
-            prev = n;
+            *prev_p = n;
         }
     }
p = ofd_node_child(m, n);
     if ( p > 0 ) {
-        head = ofd_find_by_prop(m, head, prev, p, name, val, sz);
+        head = ofd_find_by_prop(m, head, prev_p, p, name, val, sz);
     }
p = ofd_node_peer(m, n);
@@ -933,7 +933,8 @@ ofdn_t ofd_node_find_by_prop(
         n = OFD_ROOT;
     }
- return ofd_find_by_prop(m, -1, -1, n, name, val, sz);
+    ofdn_t prev = -1;
+    return ofd_find_by_prop(m, -1, &prev, n, name, val, sz);
 }
ofdn_t ofd_node_find_next(void *mem, ofdn_t n)

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel



_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>