All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Question about Coding-Style
Date: Tue, 04 Feb 2014 15:14:28 +0100	[thread overview]
Message-ID: <52F0F5C4.2010304@denx.de> (raw)
In-Reply-To: <11685.213.33.116.116.1391518218.squirrel@petermaier.org>

Hi Hannes,

On 04/02/2014 13:50, 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 

Right

> (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 ?

Yes, it is. Same rule as in kernel.

> 
> In fact i've found a lot of files within the u-boot code which do not obey
> to this rules.

I cannot tell for each exceptions you found. Maybe the code is very old,
and it slipped into mainline without fixing the lenght. There are also
some well-known exception (generally for tables), where a longer line
was accepted after discussion in the ML to increase readability.
(tables for pinmux, as example arch/arm/include/asm/arch-mx6/mx6dl_pins.h).

> 
> Now my question is, how strong are this two points ?

They are strong until there is a general acceptance on the ML to drop
the rule. However, the rule was already discussed in the past (you can
dig deep in archives), and the result was to maintain it, exactly as it
is valid for linux.


> 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.

checkpatch is run before merging a patch into a merge tree by
custodians. If checkpatch reports errors, they must be fixed.

> 
> whats your opinion about this ?
> 
> Last question:
> Is this mailing list the right place of discussing such things ?
> 

I think you are in the right place to discuss these topics ;-)

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  reply	other threads:[~2014-02-04 14:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 12:50 [U-Boot] Question about Coding-Style Hannes Petermaier
2014-02-04 14:14 ` Stefano Babic [this message]
2014-02-04 14:18   ` Michael Trimarchi
2014-02-04 14:50   ` Hannes Petermaier
2014-02-04 15:02     ` Stefano Babic
2014-02-04 15:07       ` Tom Rini
2014-02-10  9:58         ` Albert ARIBAUD
2014-02-10 10:16           ` Chris Moore
2014-02-10 10:54             ` Albert ARIBAUD
2014-02-10 18:27             ` Wolfgang Denk
2014-02-04 20:32     ` Wolfgang Denk
2014-02-04 15:02 ` Tom Rini
2014-02-04 20:20 ` Wolfgang Denk
2014-02-04 22:03 ` Scott Wood
2014-02-12 13:21   ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52F0F5C4.2010304@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.