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 <[email protected]> Reviewed-by: Thorsten Blum <[email protected]> Acked-by: Viresh Kumar <[email protected]> [ rjw: Subject and changelog edits. ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 6eff055 commit a2bd1d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)