0001-timeconst.pl-Eliminate-Perl-warning.patch.conditional 1.4 KB

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