Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339278
b: refs/heads/master
c: 9c51b05
h: refs/heads/master
v: v3
  • Loading branch information
hongbo.zhang authored and Zhang Rui committed Nov 7, 2012
1 parent e400c7e commit 56964d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b6519df84afcda294c487bccb83a8caecb48acd
refs/heads/master: 9c51b05a7852183ba9654ca850bee97d38e948d5
10 changes: 6 additions & 4 deletions trunk/drivers/thermal/cpu_cooling.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ static int cpufreq_get_max_state(struct thermal_cooling_device *cdev,
struct cpumask *maskPtr;
unsigned int cpu;
struct cpufreq_frequency_table *table;
unsigned long count = 0;

mutex_lock(&cooling_cpufreq_lock);
list_for_each_entry(cpufreq_device, &cooling_cpufreq_list, node) {
Expand All @@ -263,13 +264,14 @@ static int cpufreq_get_max_state(struct thermal_cooling_device *cdev,
goto return_get_max_state;
}

while (table[i].frequency != CPUFREQ_TABLE_END) {
for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
if (table[i].frequency == CPUFREQ_ENTRY_INVALID)
continue;
i++;
count++;
}
if (i > 0) {
*state = --i;

if (count > 0) {
*state = --count;
ret = 0;
}

Expand Down

0 comments on commit 56964d5

Please sign in to comment.