Skip to contentSkip to conversation

ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info

PATCH In review Thorsten Blum 3 participants 6 messages Nov 11, 2025 – Nov 12, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info

strcpy() is deprecated; use the safer strscpy() instead.

---
 sound/soc/intel/atom/sst-atom-controls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/atom/sst-atom-controls.c +1 -1
index 38116c758717..799d4f0881e3 100644
@@ -142,7 +142,7 @@ static int sst_slot_enum_info(struct snd_kcontrol *kcontrol,
 
 	if (uinfo->value.enumerated.item > e->max - 1)
 		uinfo->value.enumerated.item = e->max - 1;
-	strcpy(uinfo->value.enumerated.name,
+	strscpy(uinfo->value.enumerated.name,
 		e->texts[uinfo->value.enumerated.item]);
 
 	return 0;
Signature · 1 line
2.51.1
#1 lore raw

PATCH 2/2 ASoC: Intel: sst: Replace deprecated strcpy in sst_acpi_probe

strcpy() is deprecated; use the safer strscpy() instead.

---
 sound/soc/intel/atom/sst/sst_acpi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/intel/atom/sst/sst_acpi.c +2 -1
index 257180630475..73624e1b138a 100644
@@ -12,6 +12,7 @@
 #include <linux/fs.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
 #include <linux/firmware.h>
@@ -356,7 +357,7 @@ static int sst_acpi_probe(struct platform_device *pdev)
 
 	/* Fill sst platform data */
 	ctx->pdata = pdata;
-	strcpy(ctx->firmware_name, mach->fw_filename);
+	strscpy(ctx->firmware_name, mach->fw_filename);
 
 	ret = sst_platform_get_resources(ctx);
 	if (ret)
Signature · 1 line
2.51.1
maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] ASoC: Intel: sst: Replace deprecated strcpy in sst_acpi_probe

Quoted 21 lines · Thorsten Blum

strcpy() is deprecated; use the safer strscpy() instead.

---
  sound/soc/intel/atom/sst/sst_acpi.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/intel/atom/sst/sst_acpi.c +1 -0
index 257180630475..73624e1b138a 100644
@@ -12,6 +12,7 @@
  #include <linux/fs.h>
  #include <linux/interrupt.h>
  #include <linux/slab.h>
+#include <linux/string.h>
  #include <linux/io.h>
  #include <linux/platform_device.h>
  #include <linux/firmware.h>

sound/soc/intel/atom/sst/sst_acpi.c static int sst_acpi_probe(struct platform_device *pdev) · line 363

Quoted 8 lines
sound/soc/intel/atom/sst/sst_acpi.c +1 -1
@@ -356,7 +357,7 @@ static int sst_acpi_probe(struct platform_device *pdev)
 
  	/* Fill sst platform data */
  	ctx->pdata = pdata;
-	strcpy(ctx->firmware_name, mach->fw_filename);
+	strscpy(ctx->firmware_name, mach->fw_filename);
 
  	ret = sst_platform_get_resources(ctx);
  	if (ret)

Thank you for the fix. I'd update the title though as 'sst' is confusing. It stands for Smart Sound Technology and applies to most things sound/soc/intel/*.

Go with either 'ASoC: Intel: atom: sst: ' or just 'ASoC: Intel: atom: '. In fact, I'd just merge the two patches together given that both address one driver - Intel atom sound driver.

Given that this is a small change, feel free to append in v2:

maintainer Reviewed-by on v1 1/2
#3 lore raw
In reply to Thorsten Blum
Quoted 13 lines · Thorsten Blum

strcpy() is deprecated; use the safer strscpy() instead.

---
  sound/soc/intel/atom/sst-atom-controls.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/atom/sst-atom-controls.c +0 -0
index 38116c758717..799d4f0881e3 100644

sound/soc/intel/atom/sst-atom-controls.c static int sst_slot_enum_info(struct snd_kcontrol *kcontrol, · line 148

Quoted 8 lines
sound/soc/intel/atom/sst-atom-controls.c +1 -1
@@ -142,7 +142,7 @@ static int sst_slot_enum_info(struct snd_kcontrol *kcontrol,
 
  	if (uinfo->value.enumerated.item > e->max - 1)
  		uinfo->value.enumerated.item = e->max - 1;
-	strcpy(uinfo->value.enumerated.name,
+	strscpy(uinfo->value.enumerated.name,
  		e->texts[uinfo->value.enumerated.item]);
 
  	return 0;

If you go for one-patch approach as suggested by me in the PATCH 2/2 review, the title should be: 'ASoC: Intel: atom: Replace strcpy() with strscpy()'

For this patch, both for v1 and v2 (if any):

#4 lore raw
Quoted 8 lines · Cezary Rojewski
Quoted 1 line · Thorsten Blum

[...]

If you go for one-patch approach as suggested by me in the PATCH 2/2 review, the title should be: 'ASoC: Intel: atom: Replace strcpy() with strscpy()'

For this patch, both for v1 and v2 (if any):

Thanks for the review.

Takashi or Mark, do you want to combine the two patches yourself and update the title or should I submit a v2?

Best,
Thorsten

maintainer
#5 lore raw
Quoted 2 lines · Thorsten Blum

Takashi or Mark, do you want to combine the two patches yourself and update the title or should I submit a v2?

Please resend.