Skip to contentSkip to conversation

ASoC: fsl: fsl_ssi: Replace deprecated strcpy() with strscpy()

PATCH Superseded [email protected] 2 participants 3 messages Nov 5, 2025 – Nov 7, 2025

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

PATCH 1/1 ASoC: fsl: fsl_ssi: Replace deprecated strcpy() with strscpy()

From: HariKrishna Sagala <[email protected]>

strcpy() is deprecated,use strscpy() instead.
No functional changes intended.

---
This patch replaces strcpy() call with the strscpy() API. strscpy() is preferred over strcpy()/strncpy() as per the kernel documentation.

Thank you.

 sound/soc/fsl/fsl_ssi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/fsl/fsl_ssi.c +1 -1
index 320108bebf30..b2e1da1781ae 100644
@@ -1447,7 +1447,7 @@ static int fsl_ssi_probe_from_dt(struct fsl_ssi *ssi)
 			dev_err(dev, "failed to get SSI index property\n");
 			return -EINVAL;
 		}
-		strcpy(ssi->card_name, "ac97-codec");
+		strscpy(ssi->card_name, "ac97-codec");
 	} else if (!of_property_read_bool(np, "fsl,ssi-asynchronous")) {
 		/*
 		 * In synchronous mode, STCK and STFS ports are used by RX

base-commit: 284922f4c563aa3a8558a00f2a05722133237fe8

Signature · 1 line
2.43.0
#1 lore raw
Quoted 11 lines · On 11/4/25 22:21, [email protected] wrote:

From: HariKrishna Sagala <[email protected]>

strcpy() is deprecated,use strscpy() instead.
No functional changes intended.

---
This patch replaces strcpy() call with the strscpy() API. strscpy() is preferred over strcpy()/strncpy() as per the kernel documentation.

Which kernel documentation and can you add why strscpy() ie better than strcpy() instead saying "as per the kernel documentation."

Quoted 20 lines

Thank you.

  sound/soc/fsl/fsl_ssi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/fsl/fsl_ssi.c +1 -1
index 320108bebf30..b2e1da1781ae 100644
@@ -1447,7 +1447,7 @@ static int fsl_ssi_probe_from_dt(struct fsl_ssi *ssi)
  			dev_err(dev, "failed to get SSI index property\n");
  			return -EINVAL;
  		}
-		strcpy(ssi->card_name, "ac97-codec");
+		strscpy(ssi->card_name, "ac97-codec");
  	} else if (!of_property_read_bool(np, "fsl,ssi-asynchronous")) {
  		/*
  		 * In synchronous mode, STCK and STFS ports are used by RX
Quoted 1 line

base-commit: 284922f4c563aa3a8558a00f2a05722133237fe8

thanks,
-- Shuah

#2 lore raw
Quoted 35 lines · Shuah Khan
Quoted 11 lines · On 11/4/25 22:21, [email protected] wrote:

From: HariKrishna Sagala <[email protected]>

strcpy() is deprecated,use strscpy() instead.
No functional changes intended.

---
This patch replaces strcpy() call with the strscpy() API. strscpy() is preferred over strcpy()/strncpy() as per the kernel documentation.

Which kernel documentation and can you add why strscpy() ie better than strcpy() instead saying "as per the kernel documentation."

Quoted 20 lines

Thank you.

  sound/soc/fsl/fsl_ssi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/fsl/fsl_ssi.c +1 -1
index 320108bebf30..b2e1da1781ae 100644
@@ -1447,7 +1447,7 @@ static int fsl_ssi_probe_from_dt(struct fsl_ssi *ssi)
  			dev_err(dev, "failed to get SSI index property\n");
  			return -EINVAL;
  		}
-		strcpy(ssi->card_name, "ac97-codec");
+		strscpy(ssi->card_name, "ac97-codec");
  	} else if (!of_property_read_bool(np, "fsl,ssi-asynchronous")) {
  		/*
  		 * In synchronous mode, STCK and STFS ports are used by RX
Quoted 5 lines
Quoted 1 line

base-commit: 284922f4c563aa3a8558a00f2a05722133237fe8

thanks,
-- Shuah

Please find the below reference links.
https://github.com/KSPP/linux/issues/88
https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy
Thank you.