From e29d9e1e2fa35982e005fc0fb7c2869729277c32 Mon Sep 17 00:00:00 2001 From: Tom Burdick Date: Tue, 9 Nov 2021 16:21:47 -0600 Subject: [PATCH] checkpatch: Add UTIL_CAT support to checkpatch Checkpatch was checking for macro concats (##), however we often use UTIL_CAT to allow for multiple macro expansion passes to succeed. Signed-off-by: Tom Burdick --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7c6b18af2e..fb2efb1d09 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5261,7 +5261,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 =~ /\#\#/ && $ctx !~ /\#\#\s*(?:__VA_ARGS__|args)\b/); + $has_arg_concat = 1 if (($ctx =~ /\#\#/ || $ctx =~ /UTIL_CAT/) && $ctx !~ /\#\#\s*(?:__VA_ARGS__|args)\b/); $dstat =~ s/^.\s*\#\s*define\s+$Ident(\([^\)]*\))?\s*//; my $define_args = $1;