summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOsama Abdelkader <osama.abdelkader@gmail.com>2025-09-03 21:20:59 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-09-05 20:51:28 +0200
commit5136380b74f1e562ad96268578f22d8b1a29cb90 (patch)
treebe3147987377181b069e96f34df02683461ae4ca
parente54ddc44506f018f75e61c76a213227bd67dffb6 (diff)
thermal: hwmon: replace deprecated strcpy() with strscpy()
Since strcpy() is deprecated and the last user of it in the thermal subsystem is thermal_hwmon_lookup_by_type(), replace strcpy() in that function with strscpy(). Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Link: https://patch.msgid.link/20250903192059.11353-1-osama.abdelkader@gmail.com [ rjw: Changelog rewrite ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/thermal/thermal_hwmon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
index 0ecccd4d8556..64cc3ab949fe 100644
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -96,7 +96,7 @@ thermal_hwmon_lookup_by_type(const struct thermal_zone_device *tz)
mutex_lock(&thermal_hwmon_list_lock);
list_for_each_entry(hwmon, &thermal_hwmon_list, node) {
- strcpy(type, tz->type);
+ strscpy(type, tz->type);
strreplace(type, '-', '_');
if (!strcmp(hwmon->type, type)) {
mutex_unlock(&thermal_hwmon_list_lock);