[U-Boot] Checkpatch warnings for "volatile"
Prabhakar Lad
prabhakar.csengg at gmail.com
Sat Oct 15 08:01:56 CEST 2011
Hi Wolfgang,
On Sat, Oct 15, 2011 at 2:54 AM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Jason,
>
> In message <20111014202224.GI7102 at titan.lakedaemon.net> you wrote:
> >
> > > > 1.) checkpatch.pl complained about volatile in source.c:312. This
> is
> > > > a register we bitbang in a loop and we don't want the compiler
> > > > optimizing it out.
> > >
> > > This would, in almost all cases, trigger a NAK due to the fact that
> > > device register accesses should be done through I/O accesors, and
> > > never through volatile pointers.
> >
> > very true, I was attempting to give a generic example. Sorry if that
> > led to any confusion.
>
> I've explained this a number of times recently - there are actually
> very, very few occasions where "volatile" actually makes sense.
>
> Agreed, but I see a piece of code where virtual address are compared.
For example in arch/arm/cpu/arm926ejs/davinci/cpu.c
In this function static inline unsigned pll_prediv(unsigned pllbase)
and
also in this static inline unsigned pll_postdiv(unsigned pllbase)
Any suggestion on this on how to tackle or let it remain stagnant?
Regards
-- Prabhakar Lad
> 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
> Conceptual integrity in turn dictates that the design must proceed
> from one mind, or from a very small number of agreeing resonant
> minds. - Frederick Brooks Jr., "The Mythical Man Month"
>
More information about the U-Boot
mailing list