summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-10-26 19:10:28 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-10-27 16:45:42 +0100
commitad0aadfda3d09067ec2440b93decfd009001477f (patch)
tree229bf3bbbd0738f01c2f47a07868d4a9759feccc /scripts/checkpatch.pl
parenta25cfdee7b46f4640dfa1a322bbf2e82c64ffbcc (diff)
downloadbarebox-ad0aadfda3d09067ec2440b93decfd009001477f.tar.gz
barebox-ad0aadfda3d09067ec2440b93decfd009001477f.tar.xz
checkpatch: fix left brace warning
Running checkpatch with perl version 5.22 occur the following warnings: Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2017. Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2267. Unescaped left brace in regex is deprecated, ... checkpatch.pl line 2268. ... lot of weird things ... )\(.*\).*\s{ <-- HERE / at ./scripts/checkpatch.pl line 2016. This patch fix these warning, an similar commit was done in linux kernel commit: 4e5d56bdf892e18832a6540b63ebf709966bce2a ("checkpatch: fix left brace warning"). Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8d96434650..f3fd3395f1 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2013,8 +2013,8 @@ 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=~/}/)) {
+ if (($line=~/$Type\s*$Ident\(.*\).*\s\{/) and
+ !($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) {
ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr);
}
@@ -2264,8 +2264,8 @@ sub process {
## }
#need space before brace following if, while, etc
- if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
- $line =~ /do{/) {
+ if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) ||
+ $line =~ /do\{/) {
ERROR("space required before the open brace '{'\n" . $herecurr);
}