Re: [PATCH v3 3/6] cpufreq: Add an interface to mark inefficient frequencies
From: Vincent Donnefort <hidden>
Date: 2021-06-14 13:40:21
From: Vincent Donnefort <hidden>
Date: 2021-06-14 13:40:21
quoted
+ for (;;) { + pos = &table[idx]; + + if (pos->frequency == CPUFREQ_ENTRY_INVALID) + continue;That would result in an infinite loop, you still want to execute the code at the bottom of the loop which increments/decrements 'idx' and exits the loop when the end of the table is reached.
Arg, indeed, sorry for that ugly thing. I'll wait for more input from Viresh before submitting a fixed version.
quoted
+ + if (pos->flags & CPUFREQ_INEFFICIENT_FREQ) { + pos->efficient = efficient; + } else { + pos->efficient = idx; + efficient = idx; + } + + if (sort == CPUFREQ_TABLE_SORTED_ASCENDING) { + if (--idx < 0) + break; + } else { + if (table[++idx].frequency == CPUFREQ_TABLE_END) + break; + } + } +} +