Skip to content

Commit

Permalink
checkpatch: allow for comments either side of a brace on case
Browse files Browse the repository at this point in the history
When specifying case we may have comments and/or braces at the end without
actually having a 'statement'.  Allow for these to occur in any order.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Oct 16, 2008
1 parent 740504c commit 3fef12d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@ sub process {
# 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*$;*)(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$|
\s*return\s+
)/xg)
{
Expand Down

0 comments on commit 3fef12d

Please sign in to comment.