Skip to content

Commit

Permalink
checkpatch: exclude asm volatile from complex macro check
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Jeff Merkey <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoePerches authored and torvalds committed Mar 15, 2016
1 parent 9cf7666 commit 42e1529
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit 42e1529

Please sign in to comment.