diff options
author | Andy Whitcroft <apw@canonical.com> | 2009-10-26 19:50:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-29 10:39:31 -0400 |
commit | 2ceb532b04b7a3b8f534d11a6e839f8b8bff94c1 (patch) | |
tree | 44dd940b3f397dfc21344c94d4827a37985c2d50 /scripts | |
parent | 131edb3418018b6da297ed389b541e697043a8b6 (diff) |
checkpatch: fix false errors due to macro concatenation
The macro concatenation (##) sequence can cause false errors when checking
macro's. Checkpatch doesn't currently know about the operator.
For example this line,
+ entry = (struct ftrace_raw_##call *)raw_data; \
is correct but it produces the following error,
ERROR: need consistent spacing around '*' (ctx:WxB)
+ entry = (struct ftrace_raw_##call *)raw_data;\
^
The line above doesn't have any spacing problems, and if you remove the
macro concatenation sequence checkpatch doesn't give any errors.
Extend identifier handling to include ## concatenation within the
definition of an identifier.
Reported-by: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 05b10d6bc581..cb2dac37aaff 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -130,7 +130,10 @@ if ($tree) { | |||
130 | 130 | ||
131 | my $emitted_corrupt = 0; | 131 | my $emitted_corrupt = 0; |
132 | 132 | ||
133 | our $Ident = qr{[A-Za-z_][A-Za-z\d_]*}; | 133 | our $Ident = qr{ |
134 | [A-Za-z_][A-Za-z\d_]* | ||
135 | (?:\s*\#\#\s*[A-Za-z_][A-Za-z\d_]*)* | ||
136 | }x; | ||
134 | our $Storage = qr{extern|static|asmlinkage}; | 137 | our $Storage = qr{extern|static|asmlinkage}; |
135 | our $Sparse = qr{ | 138 | our $Sparse = qr{ |
136 | __user| | 139 | __user| |