Skip to contentSkip to conversation

cpufreq: AMD "frequency sensitivity feedback" powersave bias for ondemand governor

DISCUSSION Dan Carpenter 1 participant 1 message Apr 14, 2016

lore
Share & tools
lore
#0 lore raw

Hello Jacob Shin,

The patch 9c5320c8ea8b: "cpufreq: AMD "frequency sensitivity feedback" powersave bias for ondemand governor" from Apr 4, 2013, leads to the following static checker warning:

drivers/cpufreq/amd_freq_sensitivity.c:98 amd_powersave_bias_target()
error: uninitialized symbol 'index'.

drivers/cpufreq/amd_freq_sensitivity.c

    83          /* this workload is not CPU bound, so choose a lower freq */
    84          if (sensitivity < od_tuners->powersave_bias) {
    85                  if (data->freq_prev == policy->cur)
    86                          freq_next = policy->cur;
    87  
    88                  if (freq_next > policy->cur)
    89                          freq_next = policy->cur;
    90                  else if (freq_next < policy->cur)
    91                          freq_next = policy->min;
    92                  else {
    93                          unsigned int index;
    94  
    95                          cpufreq_frequency_table_target(policy,
    96                                  od_info->freq_table, policy->cur - 1,
    97                                  CPUFREQ_RELATION_H, &index);

If cpufreq_frequency_table_target() return -EINVAL the index isn't set.

    98                          freq_next = od_info->freq_table[index].frequency;
    99                  }

regards,
dan carpenter