Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56601
b: refs/heads/master
c: 7c40542
h: refs/heads/master
i:
  56599: 278cea5
v: v3
  • Loading branch information
David Gibson authored and Paul Mackerras committed May 17, 2007
1 parent 9e03954 commit 6969fd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3d67b663b5ededac1b2c552b4f0b4fbe94d7ac3
refs/heads/master: 7c40542ffaa20e361f5f37d112aba41a725fc759
17 changes: 8 additions & 9 deletions trunk/arch/powerpc/boot/flatdevtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,28 +891,27 @@ int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
struct ft_atom atom;
void *node;
char *p, *next;
int nextra, depth;
int nextra;

node = ft_node_ph2node(cxt, phandle);
if (node == NULL)
return -1;

depth = 0;
p = node;
next = ft_next(cxt, node, &atom);
if (atom.tag != OF_DT_BEGIN_NODE)
/* phandle didn't point to a node */
return -1;
p = next;

while ((next = ft_next(cxt, p, &atom)) != NULL) {
switch (atom.tag) {
case OF_DT_BEGIN_NODE:
++depth;
break;
case OF_DT_BEGIN_NODE: /* properties must go before subnodes */
case OF_DT_END_NODE:
if (--depth > 0)
break;
/* haven't found the property, insert here */
cxt->p = p;
return ft_prop(cxt, propname, buf, buflen);
case OF_DT_PROP:
if ((depth != 1) || strcmp(atom.name, propname))
if (strcmp(atom.name, propname))
break;
/* found an existing property, overwrite it */
nextra = _ALIGN(buflen, 4) - _ALIGN(atom.size, 4);
Expand Down

0 comments on commit 6969fd2

Please sign in to comment.