Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joshua Yeong and committed by
Rafael J. Wysocki
a2bd1d26 6eff0552

+2 -2
+2 -2
drivers/cpufreq/freq_table.c
··· 194 194 } 195 195 if (optimal.driver_data > i) { 196 196 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); 198 198 return 0; 199 199 } 200 200 ··· 254 254 if (show_boost ^ (pos->flags & CPUFREQ_BOOST_FREQ)) 255 255 continue; 256 256 257 - count += sprintf(&buf[count], "%d ", pos->frequency); 257 + count += sprintf(&buf[count], "%u ", pos->frequency); 258 258 } 259 259 count += sprintf(&buf[count], "\n"); 260 260