netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: William Allen Simpson <william.allen.simpson@gmail.com>
Cc: Linux Kernel Developers <linux-kernel@vger.kernel.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: warning: massive change to conditional coding style in net?
Date: Mon, 30 Nov 2009 13:44:14 +0000	[thread overview]
Message-ID: <20091130134414.GB7114@ff.dom.local> (raw)
In-Reply-To: <4B13A025.7000103@gmail.com>

On 30-11-2009 11:36, William Allen Simpson wrote:
> Over the past several days, David Miller (with help from Joe Perches)
> made sweeping changes to the format of conditional statements in the
> net tree -- the equivalent of mass patches that change spaces.
> 
> This makes writing patches for multiple versions of the tree very
> difficult, and will make future pullups problematic.  It's enough to
> make a grown man cry....  Patching conflicts everywhere!
> 
> CodingStyle is mute on this issue.  Does Linus have a preference?
> 
> My personal practice (based on decades of open source projects) has
> been to use a form already used in the same file or section of code,
> matching the existing practice.
> 
> If this is to be done everywhere, CodingStyle (and SubmittingPatches)
> should be updated.
> 
> Currently, roughly 19% (7855 lines) of the -2.6 tree uses leading form:
> 
> 	if (condition
> 	    && condition
> 	    && (condition
> 	        || condition
> 	        || condition)) {
> 
> Single spaced is also fairly common:
> 
> 	if (condition
> 	 && condition
> 	 && (condition
> 	  || condition
> 	  || condition)) {
> 
> The advantage of the leading form is *readability* due to indentation,
> ease of patching and reading patches (changes affect only 1 line,
> instead of previous and following lines), and especially conditionals
> within #if sections.  Also, shorter lines (by 3 characters).
> 
> The other 81% uses trailing form, often with odd random line breaks:
> 
> 	if (condition &&
>              condition && (condition || condition ||
> 	    condition)) {
> 
> Miller (with Perches) changed hundreds (thousands?) of these to
> trailing form.  This results in a number of hilarious examples --
> lines with both leading and trailing, lines with only &&, etc.  A
> small sample for illustration:

Yes, it's even enough to make a grown man laugh....

Jarek P.

  reply	other threads:[~2009-11-30 13:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30 10:36 warning: massive change to conditional coding style in net? William Allen Simpson
2009-11-30 13:44 ` Jarek Poplawski [this message]
2009-11-30 13:54   ` Alan Cox
2009-11-30 19:39     ` Jarek Poplawski
2009-11-30 17:56 ` Joe Perches
2009-12-01 16:08   ` William Allen Simpson
2009-12-01 16:49     ` Eric Dumazet
2009-12-01 17:43     ` Jarek Poplawski
2009-11-30 20:36 ` David Miller
2009-12-01 17:56   ` William Allen Simpson
2009-12-01 18:30     ` Eric Dumazet
2009-12-01 23:28     ` David Miller

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=20091130134414.GB7114@ff.dom.local \
    --to=jarkao2@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=william.allen.simpson@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).