public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>,
	Guenter Roeck <guenter.roeck@ericsson.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Hans de Goede <hdegoede@redhat.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Paul Goyette <paul@whooppee.com>,
	"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH] scripts/checkpatch.pl: Add strict test of logical test continuations at beginning of line
Date: Sun, 11 Jul 2010 21:34:44 +0200	[thread overview]
Message-ID: <20100711213444.4243014c@hyperion.delvare> (raw)
In-Reply-To: <1278874632.1501.68.camel@Joe-Laptop.home>

On Sun, 11 Jul 2010 11:57:12 -0700, Joe Perches wrote:
> On Sun, 2010-07-11 at 18:21 +0200, Jean Delvare wrote:
> > On Sun, 11 Jul 2010 09:16:58 -0700, Guenter Roeck wrote:
> > > On Sun, Jul 11, 2010 at 11:31:06AM -0400, Joe Perches wrote:
> > > > Kernel style seems to prefer having logical tests at
> > > > end of line rather than start of line.
> > > Ok. Would be nice to have checkpatch.pl complain about it, though,
> > > if it is a to-be-enforced rule.
> > Please, not again. This has been discussed before, with the conclusion
> > that nobody really cares and we don't want to add pointless warnings to
> > checkpatch.pl, which in the end will just dissuade people from running
> > the script and/or contributing to the kernel at all.
> 
> I don't remember that discussion.  Link?

http://lkml.org/lkml/2009/12/5/65

You started the thread, so I would think you'd remember it.

> Here's a patch that makes it a "--strict" option
> for those who really want to get all the style
> checking options.
> 
> It also corrects a spelling typo.

It's the wrong way of writing patches. Separate things go to separate
patches.

> Signed-off-by: Joe Perches <joe@perches.com
> ---
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index bd88f11..f0a4c25 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2180,6 +2180,11 @@ sub process {
>  			ERROR("space required before the open parenthesis '('\n" . $herecurr);
>  		}
>  
> +# Strict only - logical tests should be at EOL, not beginning of new lines
> +		if ($line=~/^.\s*(\&\&|\|\|)/) {
> +			CHK("logical test continuations should be on the previous line\n" . $hereprev);
> +		}
> +

As long as it doesn't bug me by default, I don't really care. But I
still believe this is a waste of everybody's time.

>  # Check for illegal assignment in if conditional -- and check for trailing
>  # statements after the conditional.
>  		if ($line =~ /do\s*(?!{)/) {
> @@ -2299,7 +2304,7 @@ sub process {
>  
>  #no spaces allowed after \ in define
>  		if ($line=~/\#\s*define.*\\\s$/) {
> -			WARN("Whitepspace after \\ makes next lines useless\n" . $herecurr);
> +			WARN("Whitespace after \\ makes next lines useless\n" . $herecurr);
>  		}
>  
>  #warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line)
> 
> 


-- 
Jean Delvare

  reply	other threads:[~2010-07-11 19:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-11 14:53 [PATCH v2] hwmon: Add support for JEDEC JC 42.4 compliant temperature sensors Guenter Roeck
2010-07-11 15:31 ` Joe Perches
2010-07-11 16:16   ` Guenter Roeck
2010-07-11 16:21     ` Jean Delvare
2010-07-11 18:57       ` [PATCH] scripts/checkpatch.pl: Add strict test of logical test continuations at beginning of line Joe Perches
2010-07-11 19:34         ` Jean Delvare [this message]
2010-07-11 19:52           ` Joe Perches
2010-07-11 21:15             ` Guenter Roeck
2010-07-12 22:49 ` [PATCH v2] hwmon: Add support for JEDEC JC 42.4 compliant temperature sensors Andrew Morton
2010-07-12 23:07   ` Guenter Roeck

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=20100711213444.4243014c@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=davem@davemloft.net \
    --cc=guenter.roeck@ericsson.com \
    --cc=hdegoede@redhat.com \
    --cc=joe@perches.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=paul@whooppee.com \
    --cc=rdunlap@xenotime.net \
    --cc=sameo@linux.intel.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