aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/cpuidle/governors/menu.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index af7b3f6b260d..94a303739ba8 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -199,14 +199,17 @@ static u64 div_round64(u64 dividend, u32 divisor)
199 */ 199 */
200static void get_typical_interval(struct menu_device *data) 200static void get_typical_interval(struct menu_device *data)
201{ 201{
202 int i = 0, divisor = 0; 202 int i, divisor;
203 uint64_t max = 0, avg = 0, stddev = 0; 203 uint64_t max, avg, stddev;
204 int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */ 204 int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */
205 205
206again: 206again:
207 207
208 /* first calculate average and standard deviation of the past */ 208 /* first calculate average and standard deviation of the past */
209 max = avg = divisor = stddev = 0; 209 max = 0;
210 avg = 0;
211 divisor = 0;
212 stddev = 0;
210 for (i = 0; i < INTERVALS; i++) { 213 for (i = 0; i < INTERVALS; i++) {
211 int64_t value = data->intervals[i]; 214 int64_t value = data->intervals[i];
212 if (value <= thresh) { 215 if (value <= thresh) {