Skip to content

Commit ace0471

Browse files
tobluxrafaeljw
authored andcommitted
cpufreq: Replace deprecated strcpy() in cpufreq_unregister_governor()
strcpy() is deprecated; assign the NUL terminator directly instead. Link: KSPP#88 Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> [ rjw: Subject tweaks ] Link: https://patch.msgid.link/20251017153354.82009-2-thorsten.blum@linux.dev Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 5313ec4 commit ace0471

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/cpufreq/cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2553,7 +2553,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor)
25532553
for_each_inactive_policy(policy) {
25542554
if (!strcmp(policy->last_governor, governor->name)) {
25552555
policy->governor = NULL;
2556-
strcpy(policy->last_governor, "\0");
2556+
policy->last_governor[0] = '\0';
25572557
}
25582558
}
25592559
read_unlock_irqrestore(&cpufreq_driver_lock, flags);

0 commit comments

Comments
 (0)