[U-Boot] Question about Coding-Style

Tom Rini trini at ti.com
Tue Feb 4 16:02:28 CET 2014


On Tue, Feb 04, 2014 at 12:50:18PM -0000, Hannes Petermaier wrote:
> Hello,
> 
> 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.
> 
> 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 ?
> 
> In fact i've found a lot of files within the u-boot code which do not obey
> to this rules.

The exceptions to the line length rule are printed strings, as breaking
them up can make debugging harder than it should be.

> 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 ?
> 
> Last question:
> Is this mailing list the right place of discussing such things ?

It's not debatable, really.  It's important for a project to be
consistent (as much as possible) in coding style, and if it helps,
recall the old adage about a good compromise leaves everyone unhappy
about something.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140204/0729abd8/attachment.pgp>


More information about the U-Boot mailing list