mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
cpufreq: Fix up printing large CPU numbers and frequency values
A negative CPU number or frequency value may be printed if they are really large (which is unlikely, though). Signed-off-by: Joshua Yeong <joshua.yeong@starfivetech.com> Reviewed-by: Thorsten Blum <thorsten.blum@toblux.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> [ rjw: Subject and changelog edits. ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
6eff05526c
commit
a2bd1d268e
@ -194,7 +194,7 @@ int cpufreq_table_index_unsorted(struct cpufreq_policy *policy,
|
|||||||
}
|
}
|
||||||
if (optimal.driver_data > i) {
|
if (optimal.driver_data > i) {
|
||||||
if (suboptimal.driver_data > i) {
|
if (suboptimal.driver_data > i) {
|
||||||
WARN(1, "Invalid frequency table: %d\n", policy->cpu);
|
WARN(1, "Invalid frequency table: %u\n", policy->cpu);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ static ssize_t show_available_freqs(struct cpufreq_policy *policy, char *buf,
|
|||||||
if (show_boost ^ (pos->flags & CPUFREQ_BOOST_FREQ))
|
if (show_boost ^ (pos->flags & CPUFREQ_BOOST_FREQ))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
count += sprintf(&buf[count], "%d ", pos->frequency);
|
count += sprintf(&buf[count], "%u ", pos->frequency);
|
||||||
}
|
}
|
||||||
count += sprintf(&buf[count], "\n");
|
count += sprintf(&buf[count], "\n");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user