ASoC: Intel: atom: Replace deprecated strcpy in sst_slot_enum_info
Subsystems (3)
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
@@ -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
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
@@ -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
Re: [PATCH 2/2] ASoC: Intel: sst: Replace deprecated strcpy in sst_acpi_probe
Quoted 21 lines · Thorsten Blum
strcpy()is deprecated; use the saferstrscpy()instead.Signed-off-by Thorsten Blum <[email protected]>--- 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@@ -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:
Quoted 13 lines · Thorsten Blum
strcpy()is deprecated; use the saferstrscpy()instead.Signed-off-by Thorsten Blum <[email protected]>--- 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
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):
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()withstrscpy()'For this patch, both for v1 and v2 (if any):
Reviewed-by Cezary Rojewski <[email protected]>
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
Mark Brown
maintainerQuoted 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.