[PATCH 1/4] Add helpers for finding a device node which as a certain property

Michael Ellerman michael at ellerman.id.au
Thu Nov 13 17:49:05 EST 2008


On Wed, 2008-11-12 at 22:46 -0800, David Miller wrote:
> From: Michael Ellerman <michael at ellerman.id.au>
> Date: Thu, 13 Nov 2008 15:20:35 +1100 (EST)
> 
> > +	np = from ? from->allnext : allnodes;
> > +	for (; np; np = np->allnext) {
> > +		for (pp = np->properties; pp != 0; pp = pp->next) {
> > +			if (of_prop_cmp(pp->name, prop_name) == 0) {
> > +				goto out;
> > +			}
> > +		}
> > +	}
> 
> We're starting to duplicate a lot of code in this file.

Agreed.

> Perhaps split out the locked section of of_find_proeprty() into
> a __of_find_property() and use that here and in of_find_property()
> as well?

Yeah I thought about it, but decided it wasn't worth it. But I'll try it
and see how the sizes end up.

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20081113/703eedb3/attachment.pgp>


More information about the Linuxppc-dev mailing list