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