Skip to content

Commit d8a1a30

Browse files
hsdenxtrini
authored andcommitted
checkpatch: fix left brace warning
using checkpatch with Perl 5.22.0 generates a warning, this is fixed in linux through commit: commit 4e5d56b Author: Eddie Kovsky <ewk@edkovsky.org> Date: Wed Sep 9 15:37:52 2015 -0700 checkpatch: fix left brace warning Using checkpatch.pl with Perl 5.22.0 generates the following warning: Unescaped left brace in regex is deprecated, passed through in regex; This patch fixes the warnings by escaping occurrences of the left brace inside the regular expression. Adapt it for U-Boot. Signed-off-by: Heiko Schocher <hs@denx.de>
1 parent 1aa2d07 commit d8a1a30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/checkpatch.pl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2825,8 +2825,8 @@ sub process {
28252825

28262826
# function brace can't be on same line, except for #defines of do while,
28272827
# or if closed on same line
2828-
if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
2829-
!($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
2828+
if (($line=~/$Type\s*$Ident\(.*\).*\s\{/) and
2829+
!($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) {
28302830
ERROR("OPEN_BRACE",
28312831
"open brace '{' following function declarations go on the next line\n" . $herecurr);
28322832
}
@@ -3259,8 +3259,8 @@ sub process {
32593259
## }
32603260

32613261
#need space before brace following if, while, etc
3262-
if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
3263-
$line =~ /do{/) {
3262+
if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) ||
3263+
$line =~ /do\{/) {
32643264
if (ERROR("SPACING",
32653265
"space required before the open brace '{'\n" . $herecurr) &&
32663266
$fix) {
@@ -3633,7 +3633,7 @@ sub process {
36333633
$dstat !~ /^for\s*$Constant$/ && # for (...)
36343634
$dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ && # for (...) bar()
36353635
$dstat !~ /^do\s*{/ && # do {...
3636-
$dstat !~ /^\({/ && # ({...
3636+
$dstat !~ /^\(\{/ && # ({...
36373637
$ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/)
36383638
{
36393639
$ctx =~ s/\n*$//;

0 commit comments

Comments
 (0)