checkpatch: fix perl version 5.12 and earlier incompatibility
authorJoe Perches <joe@perches.com>
Wed, 11 Sep 2013 21:24:04 +0000 (14:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Sep 2013 22:58:49 +0000 (15:58 -0700)
A previous patch ("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.

Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index 55277a8e1527806f272fdbe419638836dafa2912..9ba4fc44112aeae66e7e9bc85def66e1cb0327de 100755 (executable)
@@ -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";