[LinuxBIOS] Coding style

Stefan Reinauer stepan at coresystems.de
Fri May 26 18:21:56 CEST 2006

* Ronald G Minnich <rminnich at lanl.gov> [060526 01:50]:
> Carl-Daniel Hailfinger wrote:
> > What coding style is preferred if I want to merge the lzma
> > code into LinuxBIOS?
> > 
> > * plain code, as found in upstream sources (a mess)

Please don't. Except it is a part that must be updated frequently.
(x86emu would have been such an example)

> > * all unneeded #ifdef sections removed

definitely. This is becoming an issue. We have some code paths that are
not fundamentally different but still cause the code to be hard to read.
CONFIG_USE_INIT for example.

> > * additionally proper indentation (tab=8)

Yes, too deep code should hurt the eye and make the reader factor it.

> > * additionally Lindented to Linux kernel style
> linux-c-mode, so yeah, lindent.

basically indent -kr -i8

> > Also, what types should I use for variables?
> > * uint8_t ...

> that's a mess in linuxbios right now. Stefan, you have a preference?

* uint8_t ... for types. The exception from the rule is romcc code which
  is said to be worse if you use types other than "unsigned" and
  "signed" (which should be fixed in the compiler, not in the code)

coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.dehttp://www.coresystems.de/

More information about the coreboot mailing list