Skip to contentSkip to conversation

checkpatch: improve MULTISTATEMENT_MACRO_USE_DO_WHILE test

PATCH New [email protected] 1 participant 1 message May 8, 2017 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 26/114 checkpatch: improve MULTISTATEMENT_MACRO_USE_DO_WHILE test

From: Joe Perches <[email protected]>
Subject: checkpatch: improve MULTISTATEMENT_MACRO_USE_DO_WHILE test

The logic currrently misses macros that start with an if statement.

e.g.: #define foo(bar) if (bar) baz;

Add a test for macro content that starts with if

---

 scripts/checkpatch.pl |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-improve-multistatement_macro_use_do_while-test +0 -0
diff -puN scripts/checkpatch.pl~checkpatch-improve-multistatement_macro_use_do_while-test scripts/checkpatch.pl
@@ -4849,8 +4849,10 @@ sub process {
 			    $dstat !~ /^\(\{/ &&						# ({...
 			    $ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/)
 			{