[U-Boot] Question about Coding-Style
Wolfgang Denk
wd at denx.de
Tue Feb 4 21:20:52 CET 2014
Dear Hannes,
In message <11685.213.33.116.116.1391518218.squirrel at petermaier.org> you wrote:
>
> I've read on the U-Boot website about coding style. They say 'All
> contributions to U-Boot should conform to the Linux kernel coding style'.
> Further i've read this link and there are at least 2 things which i have
> troubles with.
>
> 1)
> a tab-ident is 8 spaces (in eclipse for example with the built in K&R has
> 4 characters). With 8 characters per TAB the problem from point 2 enters
> very, very fast.
Please read the CodingStyle document completely. It says:
... and have the added benefit of warning you when you're
nesting your functions too deep. Heed that warning.
> 2)
> a line ist limited to 80 characters (maybe thus comes from very old days
> where displays couldn't show more than this and scrolling was very
> expensive). is this state of the art ?
Yes, it is. Please read the CodingStyle document.
> In fact i've found a lot of files within the u-boot code which do not obey
> to this rules.
That should not be that many files, resp. only such where there were
good reasons for allowing for longer lines (like tables of GPIO
initializations, not breaking printable strings, etc.). Of course,
poorly formatted code can be found here and there - cleanup patches
are always welcome.
> Now my question is, how strong are this two points ?
> checkpatch.pl rails against a patch file with a lot of warnings if there
> is a line longer than 80bytes, also it takes TABS as 8 spaces.
>
> whats your opinion about this ?
Please fix these issues before posting the patch.
> Is this mailing list the right place of discussing such things ?
Sure.
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
The only time the world beats a path to your door is when you are in
the bathroom.
More information about the U-Boot
mailing list