Skip to content

Commit e942e2c

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: fix stringification macro defect
Fix checkpatch misreporting defect with stringification macros ERROR: Macros with complex values should be enclosed in parenthesis #27: FILE: arch/arm/include/asm/kgdb.h:41: +#define ___to_string(X) #X Signed-off-by: Joe Perches <[email protected]> Reported-by: Vincent Stehlé <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d875cf0 commit e942e2c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

scripts/checkpatch.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3016,6 +3016,7 @@ sub process {
30163016
$dstat !~ /^'X'$/ && # character constants
30173017
$dstat !~ /$exceptions/ &&
30183018
$dstat !~ /^\.$Ident\s*=/ && # .foo =
3019+
$dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo
30193020
$dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...)
30203021
$dstat !~ /^for\s*$Constant$/ && # for (...)
30213022
$dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ && # for (...) bar()

0 commit comments

Comments
 (0)