lkml.org 
[lkml]   [2023]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v11 10/11] cpufreq: amd-pstate: convert sprintf with sysfs_emit()
From


On 1/18/2023 1:22 PM, Perry Yuan wrote:
> replace the sprintf with a more generic sysfs_emit function
>
> No intended potential function impact
>
> Acked-by: Huang Rui <ray.huang@amd.com>
> Tested-by: Wyes Karny <wyes.karny@amd.com>
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Reviewed-by: Wyes Karny <wyes.karny@amd.com>

> ---
> drivers/cpufreq/amd-pstate.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 2e5e594dc41e..c307d67a76ae 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -694,7 +694,7 @@ static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy,
> if (max_freq < 0)
> return max_freq;
>
> - return sprintf(&buf[0], "%u\n", max_freq);
> + return sysfs_emit(buf, "%u\n", max_freq);
> }
>
> static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *policy,
> @@ -707,7 +707,7 @@ static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *poli
> if (freq < 0)
> return freq;
>
> - return sprintf(&buf[0], "%u\n", freq);
> + return sysfs_emit(buf, "%u\n", freq);
> }
>
> /*
> @@ -722,7 +722,7 @@ static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy,
>
> perf = READ_ONCE(cpudata->highest_perf);
>
> - return sprintf(&buf[0], "%u\n", perf);
> + return sysfs_emit(buf, "%u\n", perf);
> }
>
> static ssize_t show_energy_performance_available_preferences(

--
Thanks & Regards,
Wyes

\
 
 \ /
  Last update: 2023-03-26 23:47    [W:0.631 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site