checkpatch: exclude asm volatile from complex macro check
authorJoe Perches <joe@perches.com>
Tue, 15 Mar 2016 21:58:01 +0000 (14:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Mar 2016 23:55:16 +0000 (16:55 -0700)
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.

Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Jeff Merkey <linux.mdb@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index 0147c91fa549e6ab46b68c47b46425b272c37571..5c00c1c02dab6eaf5b30a04469e7e43ca1556807 100755 (executable)
@@ -4560,6 +4560,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|