Skip to contentSkip to conversation

checkpatch: Fix perl version 5.12 and earlier incompatibility

PATCH New Joe Perches 1 participant 1 message Aug 10, 2013 Checkpatch

lore
Share & tools
lore

Joe Perches

author maintainer
#0 lore raw

PATCH 1/1 checkpatch: Fix perl version 5.12 and earlier incompatibility

commit 203489a33 ("checkpatch: add --types option to report only specific message types") uses a perl syntax introduced in perl version 5.14.

Use the backward compatible perl syntax instead.

---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +2 -2
index 3ba2db6..51ee331 100755
@@ -174,9 +174,9 @@ sub hash_save_array_words {
 sub hash_show_words {
 	my ($hashRef, $prefix) = @_;
 
-	if ($quiet == 0 && keys $hashRef) {
+	if ($quiet == 0 && keys %{$hashRef}) {
 		print "NOTE: $prefix message types:";
-		foreach my $word (sort keys $hashRef) {
+		foreach my $word (sort keys %{$hashRef}) {
 			print " $word";
 		}
 		print "\n\n";