checkpatch: improve macros with flow control test
[cascardo/linux.git] / scripts / checkpatch.pl
index 8645706..77b293d 100755 (executable)
@@ -4539,7 +4539,7 @@ sub process {
                        #print "LINE<$lines[$ln-1]> len<" . length($lines[$ln-1]) . "\n";
 
                        $has_flow_statement = 1 if ($ctx =~ /\b(goto|return)\b/);
-                       $has_arg_concat = 1 if ($ctx =~ /\#\#/);
+                       $has_arg_concat = 1 if ($ctx =~ /\#\#/ && $ctx !~ /\#\#\s*(?:__VA_ARGS__|args)\b/);
 
                        $dstat =~ s/^.\s*\#\s*define\s+$Ident(?:\([^\)]*\))?\s*//;
                        $dstat =~ s/$;//g;