Skip to contentSkip to conversation

checkpatch: fix incompatibility with old perl

PATCH Applied Vladimir Sementsov-Ogievskiy 4 participants 4 messages Oct 4, 2017 – Oct 5, 2017 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: fix incompatibility with old perl

Do not use '/r' modifier which was introduced in perl 5.14.

---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +2 -1
index 3c0a28e644..0c41f1212f 100755
@@ -1432,7 +1432,8 @@ sub process {
 					qr/%[-+ *.0-9]*([hljztL]|ll|hh)?(x|X|"\s*PRI[xX][^"]*"?)/;
 
 				# don't consider groups splitted by [.:/ ], like 2A.20:12ab
-				my $tmpline = $rawline =~ s/($hex[.:\/ ])+$hex//gr;
+				my $tmpline = $rawline;
+				$tmpline =~ s/($hex[.:\/ ])+$hex//g;
 
 				if ($tmpline =~ /(?<!0x)$hex/) {
 					ERROR("Hex numbers must be prefixed with '0x'\n" .
Signature · 1 line
2.11.1
Tested-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Wed, 4 Oct 2017 18:44:20 +0300 Vladimir Sementsov-Ogievskiy…

Do not use '/r' modifier which was introduced in perl 5.14.

---

Fixes 3e5875afc0f ("checkpatch: check trace-events code style")

Thanks

Quoted 17 lines
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +2 -1
index 3c0a28e644..0c41f1212f 100755
@@ -1432,7 +1432,8 @@ sub process {
 					qr/%[-+ *.0-9]*([hljztL]|ll|hh)?(x|X|"\s*PRI[xX][^"]*"?)/;
 
 				# don't consider groups splitted by [.:/ ], like 2A.20:12ab
-				my $tmpline = $rawline =~ s/($hex[.:\/ ])+$hex//gr;
+				my $tmpline = $rawline;
+				$tmpline =~ s/($hex[.:\/ ])+$hex//g;
 
 				if ($tmpline =~ /(?<!0x)$hex/) {
 					ERROR("Hex numbers must be prefixed with '0x'\n" .
Reviewed-by on v1 1/1
#2 lore raw
In reply to Vladimir Sementsov-Ogievskiy
Quoted 6 lines · Vladimir Sementsov-Ogievskiy

Do not use '/r' modifier which was introduced in perl 5.14.

---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 6 lines
scripts/checkpatch.pl +0 -0
index 3c0a28e644..0c41f1212f 100755

scripts/checkpatch.pl sub process { · line 1439

Quoted 9 lines
scripts/checkpatch.pl +2 -1
@@ -1432,7 +1432,8 @@ sub process {
 					qr/%[-+ *.0-9]*([hljztL]|ll|hh)?(x|X|"\s*PRI[xX][^"]*"?)/;
 
 				# don't consider groups splitted by [.:/ ], like 2A.20:12ab
-				my $tmpline = $rawline =~ s/($hex[.:\/ ])+$hex//gr;
+				my $tmpline = $rawline;
+				$tmpline =~ s/($hex[.:\/ ])+$hex//g;
 
 				if ($tmpline =~ /(?<!0x)$hex/) {
 					ERROR("Hex numbers must be prefixed with '0x'\n" .

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|