Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info
@ 2025-11-11 22:47 Thorsten Blum
  2025-11-11 22:47 ` [PATCH 2/2] ASoC: Intel: sst: Replace deprecated strcpy in sst_acpi_probe Thorsten Blum
  2025-11-12 11:44 ` [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info Cezary Rojewski
  0 siblings, 2 replies; 6+ messages in thread
From: Thorsten Blum @ 2025-11-11 22:47 UTC (permalink / raw)
  To: Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto
  Cc: Thorsten Blum, linux-sound, linux-kernel

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

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 sound/soc/intel/atom/sst-atom-controls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c
index 38116c758717..799d4f0881e3 100644
--- a/sound/soc/intel/atom/sst-atom-controls.c
+++ b/sound/soc/intel/atom/sst-atom-controls.c
@@ -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;
-- 
2.51.1


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

* [PATCH 2/2] ASoC: Intel: sst: Replace deprecated strcpy in sst_acpi_probe
  2025-11-11 22:47 [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info Thorsten Blum
@ 2025-11-11 22:47 ` Thorsten Blum
  2025-11-12 11:41   ` Cezary Rojewski
  2025-11-12 11:44 ` [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info Cezary Rojewski
  1 sibling, 1 reply; 6+ messages in thread
From: Thorsten Blum @ 2025-11-11 22:47 UTC (permalink / raw)
  To: Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: Thorsten Blum, linux-sound, linux-kernel

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

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 sound/soc/intel/atom/sst/sst_acpi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
index 257180630475..73624e1b138a 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -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)
-- 
2.51.1


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

* Re: [PATCH 2/2] ASoC: Intel: sst: Replace deprecated strcpy in sst_acpi_probe
  2025-11-11 22:47 ` [PATCH 2/2] ASoC: Intel: sst: Replace deprecated strcpy in sst_acpi_probe Thorsten Blum
@ 2025-11-12 11:41   ` Cezary Rojewski
  0 siblings, 0 replies; 6+ messages in thread
From: Cezary Rojewski @ 2025-11-12 11:41 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: linux-sound, linux-kernel, Liam Girdwood, Peter Ujfalusi,
	Bard Liao, Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart,
	Mark Brown, Jaroslav Kysela, Takashi Iwai

On 2025-11-11 11:47 PM, Thorsten Blum wrote:
> strcpy() is deprecated; use the safer strscpy() instead.
> 
> Link: https://github.com/KSPP/linux/issues/88
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>   sound/soc/intel/atom/sst/sst_acpi.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
> index 257180630475..73624e1b138a 100644
> --- a/sound/soc/intel/atom/sst/sst_acpi.c
> +++ b/sound/soc/intel/atom/sst/sst_acpi.c
> @@ -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)

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:

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>

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

* Re: [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info
  2025-11-11 22:47 [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info Thorsten Blum
  2025-11-11 22:47 ` [PATCH 2/2] ASoC: Intel: sst: Replace deprecated strcpy in sst_acpi_probe Thorsten Blum
@ 2025-11-12 11:44 ` Cezary Rojewski
  2025-11-12 17:23   ` Thorsten Blum
  1 sibling, 1 reply; 6+ messages in thread
From: Cezary Rojewski @ 2025-11-12 11:44 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: linux-sound, linux-kernel, Liam Girdwood, Peter Ujfalusi,
	Bard Liao, Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto



On 2025-11-11 11:47 PM, Thorsten Blum wrote:
> strcpy() is deprecated; use the safer strscpy() instead.
> 
> Link: https://github.com/KSPP/linux/issues/88
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>   sound/soc/intel/atom/sst-atom-controls.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c
> index 38116c758717..799d4f0881e3 100644
> --- a/sound/soc/intel/atom/sst-atom-controls.c
> +++ b/sound/soc/intel/atom/sst-atom-controls.c
> @@ -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):

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>

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

* Re: [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info
  2025-11-12 11:44 ` [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info Cezary Rojewski
@ 2025-11-12 17:23   ` Thorsten Blum
  2025-11-12 17:55     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Thorsten Blum @ 2025-11-12 17:23 UTC (permalink / raw)
  To: Cezary Rojewski
  Cc: linux-sound, linux-kernel, Liam Girdwood, Peter Ujfalusi,
	Bard Liao, Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto

On 12. Nov 2025, at 12:44, Cezary Rojewski wrote:
> On 2025-11-11 11:47 PM, Thorsten Blum wrote:
>> [...]
> 
> 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):
> 
> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>

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


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

* Re: [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info
  2025-11-12 17:23   ` Thorsten Blum
@ 2025-11-12 17:55     ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2025-11-12 17:55 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Cezary Rojewski, linux-sound, linux-kernel, Liam Girdwood,
	Peter Ujfalusi, Bard Liao, Ranjani Sridharan, Kai Vehmanen,
	Pierre-Louis Bossart, Jaroslav Kysela, Takashi Iwai,
	Kuninori Morimoto

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

On Wed, Nov 12, 2025 at 06:23:02PM +0100, Thorsten Blum wrote:

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

Please resend.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2025-11-12 17:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-11 22:47 [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info Thorsten Blum
2025-11-11 22:47 ` [PATCH 2/2] ASoC: Intel: sst: Replace deprecated strcpy in sst_acpi_probe Thorsten Blum
2025-11-12 11:41   ` Cezary Rojewski
2025-11-12 11:44 ` [PATCH 1/2] ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info Cezary Rojewski
2025-11-12 17:23   ` Thorsten Blum
2025-11-12 17:55     ` Mark Brown

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