From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/7] davinci: eliminate use of IO_ADDRESS() on sysmod
Date: Tue, 15 Mar 2011 10:00:10 +0100 [thread overview]
Message-ID: <201103151000.10350.arnd@arndb.de> (raw)
In-Reply-To: <B85A65D85D7EB246BE421B3FB0FBB593024C246CB1@dbde02.ent.ti.com>
On Tuesday 15 March 2011 07:00:44 Nori, Sekhar wrote:
> > * If you need to access sysmod in multiple places, a nicer
> > way would be to make the virtual address pointer static,
> > and export the accessor functions for it, rather than
> > having a global pointer.
>
> Seems like opinion is divided on this. A while back
> I submitted a patch with such an accessor function and
> was asked to do the opposite of what you are asking here.
>
> https://patchwork.kernel.org/patch/366501/
>
> It can be changed to the way you are asking, but would
> like to know what is more universally acceptable (if
> at all there is such a thing).
One difference is that the base address pointer here
can be treated as read-only by using an accessor function,
which was not possible for the case you cited. Doing
an inline function would also let you make the access
more type-safe, e.g forcing the right kind of readl/writel
variant and possibly locking if necessary.
I would also argue against Sergei's point for the other
patch -- the current solution is not better than the originally
suggested one IMHO. I believe a better way would have
been to pass the maximum frequency as an argument to
da850_register_cpufreq() in that case.
However, neither of these discussion is really important,
and we don't have a strict rule for doing it one way
or the other. Just use common sense and decide case-by-case,
as I said in the previous comment, you got the important
parts right.
Arnd
prev parent reply other threads:[~2011-03-15 9:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-14 13:55 [PATCH 2/7] davinci: eliminate use of IO_ADDRESS() on sysmod Manjunath Hadli
2011-03-14 14:11 ` Sergei Shtylyov
2011-03-14 16:21 ` Arnd Bergmann
2011-03-15 6:00 ` Nori, Sekhar
2011-03-15 9:00 ` Arnd Bergmann [this message]
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=201103151000.10350.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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