Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114766
b: refs/heads/master
c: a1080bf
h: refs/heads/master
v: v3
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Oct 16, 2008
1 parent 47aef20 commit aee478c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dea79cd3dfb4a50e4c3d0dcb7294f6d633b455d1
refs/heads/master: a1080bf80862c571b5f0a20cb601e24dd90e2026
17 changes: 9 additions & 8 deletions trunk/scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1363,14 +1363,6 @@ 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*$|
\s*return\s+
)/xg)
{
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
Expand Down Expand Up @@ -1986,6 +1978,15 @@ sub process {
ERROR("trailing statements should be on next line\n" . $herecurr);
}
}
# case and default should not have general statements after them
if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g &&
$line !~ /\G(?:
(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$|
\s*return\s+
)/xg)
{
ERROR("trailing statements should be on next line\n" . $herecurr);
}

# Check for }<nl>else {, these must be at the same
# indent level to be relevant to each other.
Expand Down

0 comments on commit aee478c

Please sign in to comment.