diff options
author | Joshua Yeong <joshua.yeong@starfivetech.com> | 2024-04-25 13:00:17 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-04-30 12:55:01 +0200 |
commit | a2bd1d268e5d6411ddf3a10cdd3d964aad621cab (patch) | |
tree | ce012bc5649eb96fa1d625a34b3434ab3be4fbd0 /drivers/cpufreq | |
parent | Merge tag 'cpufreq-arm-updates-6.10' of git://git.kernel.org/pub/scm/linux/ke... (diff) | |
download | linux-a2bd1d268e5d6411ddf3a10cdd3d964aad621cab.tar.xz linux-a2bd1d268e5d6411ddf3a10cdd3d964aad621cab.zip |
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>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/freq_table.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index 40e146942f3e..10e80d912b8d 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -194,7 +194,7 @@ int cpufreq_table_index_unsorted(struct cpufreq_policy *policy, } if (optimal.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; } @@ -254,7 +254,7 @@ static ssize_t show_available_freqs(struct cpufreq_policy *policy, char *buf, if (show_boost ^ (pos->flags & CPUFREQ_BOOST_FREQ)) continue; - count += sprintf(&buf[count], "%d ", pos->frequency); + count += sprintf(&buf[count], "%u ", pos->frequency); } count += sprintf(&buf[count], "\n"); |