Skip to content

Commit

Permalink
checkpatch.pl: fix unescaped left brace warnings
Browse files Browse the repository at this point in the history
Basically, same as upstream 4e5d56bdf892e18832a6540b63ebf709966bce2a.

Unescaped left brace in string literals is deprecated since
perl v5.21.1.

Change-Id: I0e5f23bef821d2dca6ff4909ddbb06f4992718d4
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3228
Tested-by: jenkins
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
  • Loading branch information
paulfertser committed May 5, 2016
1 parent a8d302f commit 18a6fdc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ sub process {
# function brace can't be on same line, except for #defines of do while,
# or if closed on same line
if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
!($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
!($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) {
ERROR("OPEN_BRACE",
"open brace '{' following function declarations go on the next line\n" . $herecurr);
}
Expand Down Expand Up @@ -2493,8 +2493,8 @@ sub process {
## }

#need space before brace following if, while, etc
if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
$line =~ /do{/) {
if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) ||
$line =~ /do\{/) {
ERROR("SPACING",
"space required before the open brace '{'\n" . $herecurr);
}
Expand Down

0 comments on commit 18a6fdc

Please sign in to comment.