* cpufreq: Fix printing large cpu and cpufreq number
@ 2024-04-25 11:00 Joshua Yeong
2024-04-25 13:56 ` Thorsten Blum
2024-04-29 3:21 ` Viresh Kumar
0 siblings, 2 replies; 4+ messages in thread
From: Joshua Yeong @ 2024-04-25 11:00 UTC (permalink / raw)
To: rafael, viresh.kumar; +Cc: linux-pm, linux-kernel, Joshua Yeong
Fix printing negative number when CPU frequency
with large number.
Signed-off-by: Joshua Yeong <joshua.yeong@starfivetech.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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cpufreq: Fix printing large cpu and cpufreq number
2024-04-25 11:00 cpufreq: Fix printing large cpu and cpufreq number Joshua Yeong
@ 2024-04-25 13:56 ` Thorsten Blum
2024-04-29 3:21 ` Viresh Kumar
1 sibling, 0 replies; 4+ messages in thread
From: Thorsten Blum @ 2024-04-25 13:56 UTC (permalink / raw)
To: Joshua Yeong; +Cc: rafael, viresh.kumar, linux-pm, linux-kernel
On 25. Apr 2024, at 13:00, Joshua Yeong <joshua.yeong@starfivetech.com> wrote:
>
> Fix printing negative number when CPU frequency
> with large number.
>
> Signed-off-by: Joshua Yeong <joshua.yeong@starfivetech.com>
Reviewed-by: Thorsten Blum <thorsten.blum@toblux.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cpufreq: Fix printing large cpu and cpufreq number
2024-04-25 11:00 cpufreq: Fix printing large cpu and cpufreq number Joshua Yeong
2024-04-25 13:56 ` Thorsten Blum
@ 2024-04-29 3:21 ` Viresh Kumar
2024-04-30 10:56 ` Rafael J. Wysocki
1 sibling, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2024-04-29 3:21 UTC (permalink / raw)
To: Joshua Yeong; +Cc: rafael, linux-pm, linux-kernel
On 25-04-24, 19:00, Joshua Yeong wrote:
> Fix printing negative number when CPU frequency
> with large number.
>
> Signed-off-by: Joshua Yeong <joshua.yeong@starfivetech.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");
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cpufreq: Fix printing large cpu and cpufreq number
2024-04-29 3:21 ` Viresh Kumar
@ 2024-04-30 10:56 ` Rafael J. Wysocki
0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2024-04-30 10:56 UTC (permalink / raw)
To: Viresh Kumar, Joshua Yeong; +Cc: linux-pm, linux-kernel
On Mon, Apr 29, 2024 at 5:21 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 25-04-24, 19:00, Joshua Yeong wrote:
> > Fix printing negative number when CPU frequency
> > with large number.
> >
> > Signed-off-by: Joshua Yeong <joshua.yeong@starfivetech.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");
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>
> --
Applied as 6.10 material with edited subject and changelog, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-04-30 10:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25 11:00 cpufreq: Fix printing large cpu and cpufreq number Joshua Yeong
2024-04-25 13:56 ` Thorsten Blum
2024-04-29 3:21 ` Viresh Kumar
2024-04-30 10:56 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®