diff options
author | 2023-01-31 17:00:15 +0800 | |
---|---|---|
committer | 2023-02-03 21:59:42 +0100 | |
commit | 3ec32b6d17c5b229c6f5d05849932af1f0c6f523 (patch) | |
tree | edc801d0757d676c439f4ee8c13f414a566c9df3 /drivers/cpufreq | |
parent | Documentation: introduce amd pstate active mode kernel command line options (diff) | |
download | linux-3ec32b6d17c5b229c6f5d05849932af1f0c6f523.tar.gz linux-3ec32b6d17c5b229c6f5d05849932af1f0c6f523.tar.bz2 linux-3ec32b6d17c5b229c6f5d05849932af1f0c6f523.zip |
cpufreq: amd-pstate: convert sprintf with sysfs_emit()
replace the sprintf with a more generic sysfs_emit function
No intended potential function impact
Acked-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Wyes Karny <wyes.karny@amd.com>
Tested-by: Wyes Karny <wyes.karny@amd.com>
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/amd-pstate.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 1ae2e0d56ed1..168a28bed6ee 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -736,7 +736,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, @@ -749,7 +749,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); } /* @@ -764,7 +764,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( |