History

checkpatch: exclude asm volatile from complex macro check

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.

Joe Perches committed 10 years ago

Commit 42e15291 parent 9cf76661 file · +3 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+3−0
@@ -4560,6 +4560,9 @@ sub process { · 4559 unmodified lines
4560 {4560 {
4561 }4561 }
4562 4562
4563 # Make asm volatile uses seem like a generic function
4564 $dstat =~ s/\b_*asm_*\s+_*volatile_*\b/asm_volatile/g;
4565
4563 my $exceptions = qr{4566 my $exceptions = qr{
4564 $Declare|4567 $Declare|
4565 module_param_named|4568 module_param_named|