Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1346791 > unrolled thread

[PATCH] checkpatch: Exclude asm volatile from complex macro check

Started byJoe Perches <joe@perches.com>
First post2016-03-01 18:30 +0100
Last post2016-03-01 18:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] checkpatch: Exclude asm volatile from complex macro check Joe Perches <joe@perches.com> - 2016-03-01 18:30 +0100

#1346791 — [PATCH] checkpatch: Exclude asm volatile from complex macro check

FromJoe Perches <joe@perches.com>
Date2016-03-01 18:30 +0100
Subject[PATCH] checkpatch: Exclude asm volatile from complex macro check
Message-ID<r7Whs-3Ha-31@gated-at.bofh.it>
asm volatile and all its variants like __asm__ __volatile__ ("<foo>")
are reported as errors with "Macros with with complex values should be
enclosed in parentheses".

Make an exception for these asm volatile macro definitions by converting
the "asm volatile" to "asm_volatile" so it appears as a single function
call and the error isn't reported.

Reported-by: Jeff Merkey <linux.mdb@gmail.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 874132b..aa94e44 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4561,6 +4561,9 @@ sub process {
 			{
 			}
 
+			# Make asm volatile uses seem like a generic function
+			$dstat =~ s/\b_*asm_*\s+_*volatile_*\b/asm_volatile/g;
+
 			my $exceptions = qr{
 				$Declare|
 				module_param_named|
-- 
2.6.3.368.gf34be46

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web