Commit 59fdc427 authored by Colin Ian King's avatar Colin Ian King Committed by Rafael J. Wysocki
Browse files

cpufreq: longhaul: Make array speeds static const



Don't populate the read-only array speeds on the stack but instead
make it static. Also makes the object code a little smaller. Replace
hard-coded loop array bounds with ARRAY_SIZE.

Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent abdea5fc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -407,10 +407,10 @@ static int guess_fsb(int mult)
{
	int speed = cpu_khz / 1000;
	int i;
	int speeds[] = { 666, 1000, 1333, 2000 };
	static const int speeds[] = { 666, 1000, 1333, 2000 };
	int f_max, f_min;

	for (i = 0; i < 4; i++) {
	for (i = 0; i < ARRAY_SIZE(speeds); i++) {
		f_max = ((speeds[i] * mult) + 50) / 100;
		f_max += (ROUNDING / 2);
		f_min = f_max - ROUNDING;