[U-Boot] checkpatch compliance
Wolfgang Denk
wd at denx.de
Thu Oct 13 22:36:48 CEST 2011
Dear Joe Hershberger,
In message <CANr=Z=bmm64Qxv+Zpc=GShY7c2KapAgh9xm-cq79TM1oQ76V5A at mail.gmail.com> you wrote:
>
> WARNING:NEW_TYPEDEFS: do not add new typedefs
> This seems rather limiting... I'm not sure why even Linux would want
> this, at least when it applies to typedefs of structs. It makes sense
> if it's a new typedef for int or something.
See the CodingStyle, start reading at "It's a _mistake_ to use typedef
for structures and pointers."
> WARNING:VOLATILE: Use of volatile is usually wrong: see
> Documentation/volatile-considered-harmful.txt
> Sometimes using volatile is correct... not sure how this fits in with
> a policy of 0 errors and 0 warnings... Should it be ignored or not?
There are very, very few cases where a volatile is actually OK, and
these should be hiddenin the lowese levels of the implementation. In
all cases where we are dealing with device I/O and similar, the
volatile shall be removed, and proper I/O accessors be used instead
(these may then actually use volatile pointer accesses internally, but
usually they don't need to either).
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
There is a theory which states that if ever anyone discovers exactly
what the Universe is for and why it is here, it will instantly dis-
appear and be replaced by something even more bizarre and inexpli-
cable. There is another theory which states that this has already
happened. -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
More information about the U-Boot
mailing list