1From 63a3f603413ffe82ad775f2d62a5afff87fd94a0 Mon Sep 17 00:00:00 2001 2From: "H. Peter Anvin" <hpa@linux.intel.com> 3Date: Thu, 7 Feb 2013 17:14:08 -0800 4Subject: [PATCH] timeconst.pl: Eliminate Perl warning 5 6defined(@array) is deprecated in Perl and gives off a warning. 7Restructure the code to remove that warning. 8 9[ hpa: it would be interesting to revert to the timeconst.bc script. 10 It appears that the failures reported by akpm during testing of 11 that script was due to a known broken version of make, not a problem 12 with bc. The Makefile rules could probably be restructured to avoid 13 the make bug, or it is probably old enough that it doesn't matter. ] 14 15Reported-by: Andi Kleen <ak@linux.intel.com> 16Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> 17Cc: Andrew Morton <akpm@linux-foundation.org> 18Cc: <stable@vger.kernel.org> 19Signed-off-by: Gustavo Zacarias <gustavo.zacarias@free-electrons.com> 20--- 21Patch status: upstream 22 23 kernel/timeconst.pl | 6 ++---- 24 1 file changed, 2 insertions(+), 4 deletions(-) 25 26diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl 27index eb51d76..3f42652 100644 28--- a/kernel/timeconst.pl 29+++ b/kernel/timeconst.pl 30@@ -369,10 +369,8 @@ if ($hz eq '--can') { 31 die "Usage: $0 HZ\n"; 32 } 33 34- @val = @{$canned_values{$hz}}; 35- if (!defined(@val)) { 36- @val = compute_values($hz); 37- } 38+ $cv = $canned_values{$hz}; 39+ @val = defined($cv) ? @$cv : compute_values($hz); 40 output($hz, @val); 41 } 42 exit 0; 43-- 442.4.10 45 46