Skip to content

Commit 3ec32b6

Browse files
Perry Yuanrafaeljw
authored andcommitted
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 <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Reviewed-by: Wyes Karny <[email protected]> Tested-by: Wyes Karny <[email protected]> Signed-off-by: Perry Yuan <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5014603 commit 3ec32b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy,
736736
if (max_freq < 0)
737737
return max_freq;
738738

739-
return sprintf(&buf[0], "%u\n", max_freq);
739+
return sysfs_emit(buf, "%u\n", max_freq);
740740
}
741741

742742
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
749749
if (freq < 0)
750750
return freq;
751751

752-
return sprintf(&buf[0], "%u\n", freq);
752+
return sysfs_emit(buf, "%u\n", freq);
753753
}
754754

755755
/*
@@ -764,7 +764,7 @@ static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy,
764764

765765
perf = READ_ONCE(cpudata->highest_perf);
766766

767-
return sprintf(&buf[0], "%u\n", perf);
767+
return sysfs_emit(buf, "%u\n", perf);
768768
}
769769

770770
static ssize_t show_energy_performance_available_preferences(

0 commit comments

Comments
 (0)