Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217588
b: refs/heads/master
c: 0c73b4e
h: refs/heads/master
v: v3
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Oct 26, 2010
1 parent 3c554b4 commit bf0a70c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 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: 8cf6de7145943caa38c56c61cd83b17687afd900
refs/heads/master: 0c73b4eb7a825a5aff16d8a9701f6c28056de058
15 changes: 5 additions & 10 deletions trunk/scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1905,22 +1905,17 @@ sub process {
ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr);
}

# missing space after union or struct definition
if ($rawline =~ /^\+\s*(union|struct)\s+$Ident[=\{]/) {
WARN("Missing space after struct or union definition\n" . $herecurr);
}

# missing space after enum definition
if ($rawline =~ /^\+\s*enum\{/) {
WARN("Missing space after enum definition\n" . $herecurr);
}

# open braces for enum, union and struct go on the same line.
if ($line =~ /^.\s*{/ &&
$prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) {
ERROR("open brace '{' following $1 go on the same line\n" . $hereprev);
}

# missing space after union, struct or enum definition
if ($line =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?(?:\s+$Ident)?[=\{]/) {
WARN("missing space after $1 definition\n" . $herecurr);
}

# check for spacing round square brackets; allowed:
# 1. with a type on the left -- int [] a;
# 2. at the beginning of a line for slice initialisers -- [0...10] = 5,
Expand Down

0 comments on commit bf0a70c

Please sign in to comment.