[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240425110017.75238-1-joshua.yeong@starfivetech.com>
Date: Thu, 25 Apr 2024 19:00:17 +0800
From: Joshua Yeong <joshua.yeong@...rfivetech.com>
To: rafael@...nel.org,
viresh.kumar@...aro.org
Cc: linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Joshua Yeong <joshua.yeong@...rfivetech.com>
Subject: cpufreq: Fix printing large cpu and cpufreq number
Fix printing negative number when CPU frequency
with large number.
Signed-off-by: Joshua Yeong <joshua.yeong@...rfivetech.com>
---
drivers/cpufreq/freq_table.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
index c17dc51a5a02..9b9568023f3c 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");
--
2.25.1
Powered by blists - more mailing lists