Commit 2ceb532b authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Linus Torvalds
Browse files

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: default avatarDaniel Walker <>
Signed-off-by: default avatarAndy Whitcroft <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 131edb34
......@@ -130,7 +130,10 @@ if ($tree) {
my $emitted_corrupt = 0;
our $Ident = qr{[A-Za-z_][A-Za-z\d_]*};
our $Ident = qr{
our $Storage = qr{extern|static|asmlinkage};
our $Sparse = qr{
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment