From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Davinci: add a pin multiplexer configuration API
Date: Fri, 30 Oct 2009 09:26:12 +0100 [thread overview]
Message-ID: <20091030082612.62AFCC88C8@gemini.denx.de> (raw)
In-Reply-To: <20091029182304.469c9f7f.kim.phillips@freescale.com>
Dear Kim Phillips,
In message <20091029182304.469c9f7f.kim.phillips@freescale.com> you wrote:
>
> > + if (field < PIN_MUX_NUM_FIELDS &&
> > + (value & ~PIN_MUX_FIELD_MASK) == 0) {
>
> the second line should not be indented as though it is the code
> subblock; it should fall directly underneath the column where 'field
> <..' starts, like this:
Agreed.
> if (field < PIN_MUX_NUM_FIELDS &&
> (value & ~PIN_MUX_FIELD_MASK) == 0) {
>
> > + int offset = field * PIN_MUX_FIELD_SIZE;
> > + unsigned int mux = pins[i].mux;
> > + unsigned int mask = PIN_MUX_FIELD_MASK << offset;
>
> also please just declare everything at the top of the function - same
> for value and field declarations above.
No! Why should that be needed? It would be just a waste of stack
space (except that recent compilers don't care abouyt this anyway),
and keeping variables as localized as possible seems to be a good
thing to me.
> > + value <<= offset;
> > + writel(value | (readl(mux) & (~mask)), mux);
>
> I guess arm doesn't have setbits32 and friends, huh.
Not yet. Patches welcome!
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Evil does seek to maintain power by suppressing the truth."
"Or by misleading the innocent."
-- Spock and McCoy, "And The Children Shall Lead",
stardate 5029.5.
next prev parent reply other threads:[~2009-10-30 8:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-29 15:38 [U-Boot] [PATCH] Davinci: add a pin multiplexer configuration API Nick Thompson
2009-10-29 23:23 ` Kim Phillips
2009-10-30 8:26 ` Wolfgang Denk [this message]
2009-10-30 14:56 ` Kim Phillips
2009-10-30 15:17 ` Thompson, Nick (GE EntSol, Intelligent Platforms)
2009-10-30 16:30 ` Kim Phillips
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=20091030082612.62AFCC88C8@gemini.denx.de \
--to=wd@denx.de \
--cc=u-boot@lists.denx.de \
/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