mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
module/cpufreq: Sort list of frequencies
Ensure the order of frequencies is deterministic to have consistent output when printing it or when using it to carry out some actions.
This commit is contained in:
parent
5bda1c0eee
commit
6fe78b4d47
@ -212,7 +212,7 @@ class CpufreqModule(Module):
|
|||||||
|
|
||||||
@memoized
|
@memoized
|
||||||
def list_frequencies(self, cpu):
|
def list_frequencies(self, cpu):
|
||||||
"""Returns a list of frequencies supported by the cpu or an empty list
|
"""Returns a sorted list of frequencies supported by the cpu or an empty list
|
||||||
if not could be found."""
|
if not could be found."""
|
||||||
if isinstance(cpu, int):
|
if isinstance(cpu, int):
|
||||||
cpu = 'cpu{}'.format(cpu)
|
cpu = 'cpu{}'.format(cpu)
|
||||||
@ -234,7 +234,7 @@ class CpufreqModule(Module):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
available_frequencies = list(map(int, reversed([f for f, _ in zip(out_iter, out_iter)])))
|
available_frequencies = list(map(int, reversed([f for f, _ in zip(out_iter, out_iter)])))
|
||||||
return available_frequencies
|
return sorted(available_frequencies)
|
||||||
|
|
||||||
@memoized
|
@memoized
|
||||||
def get_max_available_frequency(self, cpu):
|
def get_max_available_frequency(self, cpu):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user