The patch titled Subject: checkpatch: add control statement test to SINGLE_STATEMENT_DO_WHILE_MACRO has been added to the -mm tree. Its filename is checkpatch-add-control-statement-test-to-single_statement_do_while_macro.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Joe Perches <joe@xxxxxxxxxxx> Subject: checkpatch: add control statement test to SINGLE_STATEMENT_DO_WHILE_MACRO commit b13edf7ff2d ("checkpatch: add checks for do {} while (0) macro misuses") added a test that is overly simplistic for single statement macros. Macros that start with control tests should be enclosed in a do {} while (0) loop. Add the necessary control tests to the check. Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> Acked-by: Andy Whitcroft <apw@xxxxxxxxxxxxx> Tested-by: Franz Schrober <franzschrober@xxxxxxxx> Cc: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN scripts/checkpatch.pl~checkpatch-add-control-statement-test-to-single_statement_do_while_macro scripts/checkpatch.pl --- a/scripts/checkpatch.pl~checkpatch-add-control-statement-test-to-single_statement_do_while_macro +++ a/scripts/checkpatch.pl @@ -3016,7 +3016,8 @@ sub process { $herectx .= raw_line($linenr, $n) . "\n"; } - if (($stmts =~ tr/;/;/) == 1) { + if (($stmts =~ tr/;/;/) == 1 && + $stmts !~ /^\s*(if|while|for|switch)\b/) { WARN("SINGLE_STATEMENT_DO_WHILE_MACRO", "Single statement macros should not use a do {} while (0) loop\n" . "$herectx"); } _ Patches currently in -mm which might be from joe@xxxxxxxxxxx are linux-next.patch checkpatch-add-control-statement-test-to-single_statement_do_while_macro.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html