Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1201156 > unrolled thread

[PATCH] checkpatch: Fix left brace warning

Started byEddie Kovsky <ewk@edkovsky.org>
First post2015-08-05 23:40 +0200
Last post2015-08-06 21:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] checkpatch: Fix left brace warning Eddie Kovsky <ewk@edkovsky.org> - 2015-08-05 23:40 +0200
    Re: [PATCH] checkpatch: Fix left brace warning Joe Perches <joe@perches.com> - 2015-08-06 21:40 +0200

#1201156 — [PATCH] checkpatch: Fix left brace warning

FromEddie Kovsky <ewk@edkovsky.org>
Date2015-08-05 23:40 +0200
Subject[PATCH] checkpatch: Fix left brace warning
Message-ID<pUezM-59o-33@gated-at.bofh.it>
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.

Signed-off-by: Eddie Kovsky <ewk@edkovsky.org>
---
 scripts/checkpatch.pl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 50693f52d57c..a38fa70ce694 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3547,7 +3547,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=~/}/)) {
 			if (ERROR("OPEN_BRACE",
 				  "open brace '{' following function declarations go on the next line\n" . $herecurr) &&
 			    $fix) {
@@ -4059,8 +4059,8 @@ sub process {
 ## 		}
 
 #need space before brace following if, while, etc
-		if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
-		    $line =~ /do{/) {
+		if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\){/) ||
+		    $line =~ /do\{/) {
 			if (ERROR("SPACING",
 				  "space required before the open brace '{'\n" . $herecurr) &&
 			    $fix) {
@@ -4507,7 +4507,7 @@ sub process {
 			    $dstat !~ /^for\s*$Constant$/ &&				# for (...)
 			    $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ &&	# for (...) bar()
 			    $dstat !~ /^do\s*{/ &&					# do {...
-			    $dstat !~ /^\({/ &&						# ({...
+			    $dstat !~ /^\(\{/ &&						# ({...
 			    $ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/)
 			{
 				$ctx =~ s/\n*$//;
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1201991

FromJoe Perches <joe@perches.com>
Date2015-08-06 21:40 +0200
Message-ID<pUzbc-1Jm-19@gated-at.bofh.it>
In reply to#1201156
On Wed, 2015-08-05 at 15:28 -0600, Eddie Kovsky wrote:
> Using checkpatch.pl with Perl 5.22.0 generates the following warning:
> 
>     Unescaped left brace in regex is deprecated, passed through in regex;

Valdis Kletnieks sent a fix for this awhile ago:

https://lkml.org/lkml/2015/7/8/1049

Andrew can you apply it please?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web