On Fri, 2007-10-26 at 17:29 +1000, Stephen Rothwell wrote:
> On Fri, 26 Oct 2007 16:54:43 +1000 (EST) Michael Ellerman <[EMAIL PROTECTED]> 
> wrote:
> >
> > +++ b/arch/powerpc/platforms/pseries/eeh.c
> > @@ -841,11 +841,8 @@ void eeh_restore_bars(struct pci_dn *pdn)
> >     if ((pdn->eeh_mode & EEH_MODE_SUPPORTED) && !IS_BRIDGE(pdn->class_code))
> >             __restore_bars (pdn);
> >  
> > -   dn = pdn->node->child;
> > -   while (dn) {
> > +   for (dn = NULL; (dn = of_get_next_child(pdn->node, dn));)
> 
> Just wondering if we need
> 
> #define for_each_child_node(dn, parent) \
>       for (dn = of_get_next_child(parent, NULL); dn; \
>               dn = of_get_next_child(parent, dn))

Hmm, perhaps. I count ~30 places we could use it under arch/powerpc, and
about another ~20 in drivers/.

If no one objects, I guess I'll get to it, sigh ... another Yak.

Should we perhaps make it for_each_child_device_node() ?
Otherwise it's slightly non obvious what kind of node it's talking
about, especially in driver code.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to