Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105390
b: refs/heads/master
c: 8d31cfc
h: refs/heads/master
v: v3
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Jul 24, 2008
1 parent 4c29588 commit 18c227f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2a763c20b89890d2153551b1af6962b135de4c0
refs/heads/master: 8d31cfcecf67563d70cd68616cb8fb4384f24b51
11 changes: 11 additions & 0 deletions trunk/scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,17 @@ sub process {
ERROR("open brace '{' following $1 go on the same line\n" . $hereprev);
}

# 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,
while ($line =~ /(.*?\s)\[/g) {
my ($where, $prefix) = ($-[1], $1);
if ($prefix !~ /$Type\s+$/ &&
($where != 0 || $prefix !~ /^.\s+$/)) {
ERROR("space prohibited before open square bracket '['\n" . $herecurr);
}
}

# check for spaces between functions and their parentheses.
while ($line =~ /($Ident)\s+\(/g) {
my $name = $1;
Expand Down

0 comments on commit 18c227f

Please sign in to comment.