From: Michael Ellerman <michael@ellerman.id.au>
To: David Miller <davem@davemloft.net>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 1/4] Add helpers for finding a device node which as a certain property
Date: Thu, 13 Nov 2008 18:11:43 +1100 [thread overview]
Message-ID: <1226560303.7856.38.camel@localhost> (raw)
In-Reply-To: <1226558945.7856.27.camel@localhost>
[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]
On Thu, 2008-11-13 at 17:49 +1100, Michael Ellerman wrote:
> On Wed, 2008-11-12 at 22:46 -0800, David Miller wrote:
> > From: Michael Ellerman <michael@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.
With my compiler (4.3.1) it just gets inlined and actually makes the
text 8 bytes larger. We might be using different CFLAGs to sparc though.
I didn't think it made the source significantly clearer to split out the
of_find_property() logic, especially seeing as we don't need the lenp
behaviour in of_find_node_with_property().
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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-11-13 7:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-13 4:20 [PATCH 1/4] Add helpers for finding a device node which as a certain property Michael Ellerman
2008-11-13 4:20 ` [PATCH 2/4] Use for_each_node_with_property() in of_irq_map_init() Michael Ellerman
2008-11-13 4:20 ` [PATCH 3/4] Use of_find_node_with_property() in cell_iommu_fixed_mapping_init() Michael Ellerman
2008-11-13 4:20 ` [PATCH 4/4] Use of_find_node_with_property() in pmac_setup_arch() Michael Ellerman
2008-11-13 9:27 ` Benjamin Herrenschmidt
2008-11-13 6:46 ` [PATCH 1/4] Add helpers for finding a device node which as a certain property David Miller
2008-11-13 6:49 ` Michael Ellerman
2008-11-13 7:11 ` Michael Ellerman [this message]
2008-11-13 7:31 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1226560303.7856.38.camel@localhost \
--to=michael@ellerman.id.au \
--cc=davem@davemloft.net \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).