lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1278874632.1501.68.camel@Joe-Laptop.home>
Date:	Sun, 11 Jul 2010 11:57:12 -0700
From:	Joe Perches <joe@...ches.com>
To:	Jean Delvare <khali@...ux-fr.org>,
	Andy Whitcroft <apw@...onical.com>
Cc:	Guenter Roeck <guenter.roeck@...csson.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Randy Dunlap <rdunlap@...otime.net>,
	Hans de Goede <hdegoede@...hat.com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	"David S. Miller" <davem@...emloft.net>,
	Paul Goyette <paul@...oppee.com>,
	"lm-sensors@...sensors.org" <lm-sensors@...sensors.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>
Subject: [PATCH] scripts/checkpatch.pl: Add strict test of logical test
 continuations at beginning of line

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?

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.

Signed-off-by: Joe Perches <joe@...ches.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);
+		}
+
 # 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)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ