Skip to content

Commit a2bd1d2

Browse files
Joshua Yeongrafaeljw
authored andcommitted
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>
1 parent 6eff055 commit a2bd1d2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/cpufreq/freq_table.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ int cpufreq_table_index_unsorted(struct cpufreq_policy *policy,
194194
}
195195
if (optimal.driver_data > i) {
196196
if (suboptimal.driver_data > i) {
197-
WARN(1, "Invalid frequency table: %d\n", policy->cpu);
197+
WARN(1, "Invalid frequency table: %u\n", policy->cpu);
198198
return 0;
199199
}
200200

@@ -254,7 +254,7 @@ static ssize_t show_available_freqs(struct cpufreq_policy *policy, char *buf,
254254
if (show_boost ^ (pos->flags & CPUFREQ_BOOST_FREQ))
255255
continue;
256256

257-
count += sprintf(&buf[count], "%d ", pos->frequency);
257+
count += sprintf(&buf[count], "%u ", pos->frequency);
258258
}
259259
count += sprintf(&buf[count], "\n");
260260

0 commit comments

Comments
 (0)