[PATCH] PM / devfreq: Fix a index typo in trans_stat

chanwoo@kernel.org posted 1 patch 7 months, 1 week ago
drivers/devfreq/devfreq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] PM / devfreq: Fix a index typo in trans_stat
Posted by chanwoo@kernel.org 7 months, 1 week ago
From: Chanwoo Choi <cw00.choi@samsung.com>

Fixes: 4920ee6dcfaf ("PM / devfreq: Convert to use sysfs_emit_at() API")
Signed-off-by: pls <pleasurefish@126.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 46f3a8053197..c5f5960e643b 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -1733,7 +1733,7 @@ static ssize_t trans_stat_show(struct device *dev,
 	for (i = 0; i < max_state; i++) {
 		if (len >= PAGE_SIZE - 1)
 			break;
-		if (df->freq_table[2] == df->previous_freq)
+		if (df->freq_table[i] == df->previous_freq)
 			len += sysfs_emit_at(buf, len, "*");
 		else
 			len += sysfs_emit_at(buf, len, " ");
-- 
2.25.1
Re: [PATCH] PM / devfreq: Fix a index typo in trans_stat
Posted by Chanwoo Choi 7 months, 1 week ago
Applied it.

On Thu, May 15, 2025 at 11:31 PM <chanwoo@kernel.org> wrote:
>
> From: Chanwoo Choi <cw00.choi@samsung.com>
>
> Fixes: 4920ee6dcfaf ("PM / devfreq: Convert to use sysfs_emit_at() API")
> Signed-off-by: pls <pleasurefish@126.com>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  drivers/devfreq/devfreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 46f3a8053197..c5f5960e643b 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -1733,7 +1733,7 @@ static ssize_t trans_stat_show(struct device *dev,
>         for (i = 0; i < max_state; i++) {
>                 if (len >= PAGE_SIZE - 1)
>                         break;
> -               if (df->freq_table[2] == df->previous_freq)
> +               if (df->freq_table[i] == df->previous_freq)
>                         len += sysfs_emit_at(buf, len, "*");
>                 else
>                         len += sysfs_emit_at(buf, len, " ");
> --
> 2.25.1
>
>


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics