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>] [day] [month] [year] [list]
Date:	Tue, 14 Apr 2015 07:01:14 -0700
From:	Joe Perches <joe@...ches.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Andy Whitcroft <apw@...onical.com>,
	Hanna Hawa <hannah@...vell.com>,
	Yehuda Yitschak <yehuday@...vell.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] checkpatch: Avoid "spaces required around that ':'" false
 positive

Since commit 1f65f947a6a8 ("checkpatch: add checks for
question mark and colon spacing") back in 2008, checkpatch
has reported false positive for asm volatile uses of "::"
checkpatch thinks colons should always have spaces around it.

Add an exception for colons with colons on either side for
this valid asm volatile (and c++) use.

Signed-off-by: Joe Perches <joe@...ches.com>
Reported-by: Yehuda Yitschak <yehuday@...vell.com>
---
On Tue, 2015-04-14 at 08:46 +0000, Yehuda Yitschak wrote:
> i believe i found a false positive in checkpatch script
> When embedding ARM assembly code in C files checkpatch shouts about spaces after semicolon but that's the syntax of inline assembly.
> ERROR: spaces required around that ':' (ctx:WxO)
> #43: FILE: arch/arm64/kernel/perf_event.c:1221:
> +       asm volatile("msr pmuserenr_el0, %0" :: "r" (0xf));

 scripts/checkpatch.pl | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 78a951f..bf1cc43 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3837,6 +3837,14 @@ sub process {
 					    	$ok = 1;
 					}
 
+					# for asm volatile statements
+					# ignore a colon with another
+					# colon immediately before or after
+					if (($op eq ':') &&
+					    ($ca =~ /:$/ || $cc =~ /^:/)) {
+						$ok = 1;
+					}
+
 					# messages are ERROR, but ?: are CHK
 					if ($ok == 0) {
 						my $msg_type = \&ERROR;


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