summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1e7d2cdd0c20..c6782ac6f130 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1295,7 +1295,11 @@ sub process {
}
}
if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g &&
- $line !~ /\G(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$/g) {
+ $line !~ /\G(?:
+ (?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$|
+ \s*return\s+
+ )/xg)
+ {
ERROR("trailing statements should be on next line\n" . $herecurr);
}