From: Joe Perches <joe@perches.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: Preferred line-break style around binary operators?
Date: Sun, 06 Oct 2013 15:01:26 -0700 [thread overview]
Message-ID: <1381096886.2081.168.camel@joe-AO722> (raw)
In-Reply-To: <20131006214829.GA20112@leaf>
On Sun, 2013-10-06 at 14:48 -0700, Josh Triplett wrote:
> There are two common approaches to breaking long lines at binary
> operators: breaking the line before the operator (putting the operator
> at the start of the next line), or breaking the line after the operator
> (putting the operator at the end of the previous line).
>
> CodingStyle doesn't define any requirement here, and the kernel uses
> both approaches; for instance, using && as a sample:
>
> $ git grep -h '&&$' | wc -l
> 28872
> $ git grep -h '^[[:space:]]*&&' | wc -l
> 4169
>
> Which style should kernel code use? I can submit a CodingStyle patch
> documenting that preference for future reference.
That was pretty contentious awhile ago.
An example:
https://lkml.org/lkml/2009/12/5/30
net/ and drivers/net/ use && and || at EOL.
next prev parent reply other threads:[~2013-10-06 22:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-06 21:48 Josh Triplett
2013-10-06 22:01 ` Joe Perches [this message]
2013-10-06 22:11 ` Josh Triplett
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=1381096886.2081.168.camel@joe-AO722 \
--to=joe@perches.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®