From 4c29588319fbf01f4076e15af1602180e7eeef52 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Wed, 23 Jul 2008 21:29:02 -0700 Subject: [PATCH] --- yaml --- r: 105389 b: refs/heads/master c: e2a763c20b89890d2153551b1af6962b135de4c0 h: refs/heads/master i: 105387: 2a7b334310660c834d28d5b02b60c5660eddbe1d v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e1001be1dc9d..3df1a1f902c3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f4c014c0dede10cc0a8463e748892e738e190699 +refs/heads/master: e2a763c20b89890d2153551b1af6962b135de4c0 diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 614999f29aa0..5f71b3050253 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -1244,6 +1244,10 @@ sub process { ERROR("switch and case should be at the same indent\n$hereline$err"); } } + if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g && + $line !~ /\G(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$/g) { + ERROR("trailing statements should be on next line\n" . $herecurr); + } # if/while/etc brace do not go on next line, unless defining a do while loop, # or if that brace on the next line is for something else