public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] thermal: hwmon: replace deprecated strcpy() with strscpy()
@ 2025-09-03 19:20 Osama Abdelkader
  2025-09-04  7:45 ` Lukasz Luba
  0 siblings, 1 reply; 3+ messages in thread
From: Osama Abdelkader @ 2025-09-03 19:20 UTC (permalink / raw)
  To: rafael, daniel.lezcano, rui.zhang, lukasz.luba
  Cc: linux-pm, linux-kernel, Osama Abdelkader

strcpy() is deprecated, use strscpy() instead for consistency with thermal
subsystem since this is the only strcpy there.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
v2:
Improve the commit msg: add that this is the only strcpy left in thermal subsystem
---
 drivers/thermal/thermal_hwmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] thermal: hwmon: replace deprecated strcpy() with strscpy()
  2025-09-03 19:20 [PATCH v2] thermal: hwmon: replace deprecated strcpy() with strscpy() Osama Abdelkader
@ 2025-09-04  7:45 ` Lukasz Luba
  2025-09-05 18:53   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Lukasz Luba @ 2025-09-04  7:45 UTC (permalink / raw)
  To: Osama Abdelkader
  Cc: linux-pm, linux-kernel, rafael, daniel.lezcano, rui.zhang



On 9/3/25 20:20, Osama Abdelkader wrote:
> strcpy() is deprecated, use strscpy() instead for consistency with thermal
> subsystem since this is the only strcpy there.
> 
> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> ---
> v2:
> Improve the commit msg: add that this is the only strcpy left in thermal subsystem
> ---
>   drivers/thermal/thermal_hwmon.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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);


LGTM, that was indeed the single occurrence in thermal sub-system.
Thanks!

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] thermal: hwmon: replace deprecated strcpy() with strscpy()
  2025-09-04  7:45 ` Lukasz Luba
@ 2025-09-05 18:53   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2025-09-05 18:53 UTC (permalink / raw)
  To: Lukasz Luba, Osama Abdelkader
  Cc: linux-pm, linux-kernel, daniel.lezcano, rui.zhang

On Thu, Sep 4, 2025 at 9:45 AM Lukasz Luba <lukasz.luba@arm.com> wrote:
>
>
>
> On 9/3/25 20:20, Osama Abdelkader wrote:
> > strcpy() is deprecated, use strscpy() instead for consistency with thermal
> > subsystem since this is the only strcpy there.
> >
> > Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> > ---
> > v2:
> > Improve the commit msg: add that this is the only strcpy left in thermal subsystem
> > ---
> >   drivers/thermal/thermal_hwmon.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > 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);
>
>
> LGTM, that was indeed the single occurrence in thermal sub-system.
> Thanks!
>
> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

Applied as 6.18 material, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-05 18:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-03 19:20 [PATCH v2] thermal: hwmon: replace deprecated strcpy() with strscpy() Osama Abdelkader
2025-09-04  7:45 ` Lukasz Luba
2025-09-05 18:53   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox