1 From 63a3f603413ffe82ad775f2d62a5afff87fd94a0 Mon Sep 17 00:00:00 2001
2 From: "H. Peter Anvin" <hpa@linux.intel.com>
3 Date: Thu, 7 Feb 2013 17:14:08 -0800
4 Subject: [PATCH] timeconst.pl: Eliminate Perl warning
6 defined(@array) is deprecated in Perl and gives off a warning.
7 Restructure the code to remove that warning.
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. ]
15 Reported-by: Andi Kleen <ak@linux.intel.com>
16 Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
17 Cc: Andrew Morton <akpm@linux-foundation.org>
18 Cc: <stable@vger.kernel.org>
19 Signed-off-by: Gustavo Zacarias <gustavo.zacarias@free-electrons.com>
21 Patch status: upstream
23 kernel/timeconst.pl | 6 ++----
24 1 file changed, 2 insertions(+), 4 deletions(-)
26 diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
27 index eb51d76..3f42652 100644
28 --- a/kernel/timeconst.pl
29 +++ b/kernel/timeconst.pl
30 @@ -369,10 +369,8 @@ if ($hz eq '--can') {
34 - @val = @{$canned_values{$hz}};
35 - if (!defined(@val)) {
36 - @val = compute_values($hz);
38 + $cv = $canned_values{$hz};
39 + @val = defined($cv) ? @$cv : compute_values($hz);