linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsl: fsl_ssi: Replace deprecated strcpy() with strscpy()
@ 2025-11-05  5:21 hariconscious
  2025-11-06 22:28 ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: hariconscious @ 2025-11-05  5:21 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai
  Cc: khalid, shuah, david.hunter.linux, linux-sound, linux-kernel,
	HariKrishna Sagala

From: HariKrishna Sagala <hariconscious@gmail.com>

strcpy() is deprecated,use strscpy() instead.
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/88

Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
---
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(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 320108bebf30..b2e1da1781ae 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -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
-- 
2.43.0


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

* Re: [PATCH] ASoC: fsl: fsl_ssi: Replace deprecated strcpy() with strscpy()
  2025-11-05  5:21 [PATCH] ASoC: fsl: fsl_ssi: Replace deprecated strcpy() with strscpy() hariconscious
@ 2025-11-06 22:28 ` Shuah Khan
  2025-11-07  4:34   ` HariKrishna Sagala
  0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2025-11-06 22:28 UTC (permalink / raw)
  To: hariconscious, shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka,
	lgirdwood, broonie, perex, tiwai
  Cc: khalid, shuah, david.hunter.linux, linux-sound, linux-kernel,
	Shuah Khan

On 11/4/25 22:21, hariconscious@gmail.com wrote:
> From: HariKrishna Sagala <hariconscious@gmail.com>
> 
> strcpy() is deprecated,use strscpy() instead.
> No functional changes intended.
> Link: https://github.com/KSPP/linux/issues/88
> 
> Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
> ---
> 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."
> 
> Thank you.
> 
>   sound/soc/fsl/fsl_ssi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 320108bebf30..b2e1da1781ae 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -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

thanks,
-- Shuah

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

* Re: [PATCH] ASoC: fsl: fsl_ssi: Replace deprecated strcpy() with strscpy()
  2025-11-06 22:28 ` Shuah Khan
@ 2025-11-07  4:34   ` HariKrishna Sagala
  0 siblings, 0 replies; 3+ messages in thread
From: HariKrishna Sagala @ 2025-11-07  4:34 UTC (permalink / raw)
  To: Shuah Khan, hariconscious, shengjiu.wang, Xiubo.Lee, festevam,
	nicoleotsuka, lgirdwood, broonie, perex, tiwai
  Cc: khalid, shuah, david.hunter.linux, linux-sound, linux-kernel



On Thu, 6 Nov 2025, Shuah Khan wrote:

> On 11/4/25 22:21, hariconscious@gmail.com wrote:
> > From: HariKrishna Sagala <hariconscious@gmail.com>
> >
> > strcpy() is deprecated,use strscpy() instead.
> > No functional changes intended.
> > Link: https://github.com/KSPP/linux/issues/88
> >
> > Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
> > ---
> > 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."
> >
> > Thank you.
> >
> >   sound/soc/fsl/fsl_ssi.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> > index 320108bebf30..b2e1da1781ae 100644
> > --- a/sound/soc/fsl/fsl_ssi.c
> > +++ b/sound/soc/fsl/fsl_ssi.c
> > @@ -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
>
> 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.

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

end of thread, other threads:[~2025-11-07  4:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05  5:21 [PATCH] ASoC: fsl: fsl_ssi: Replace deprecated strcpy() with strscpy() hariconscious
2025-11-06 22:28 ` Shuah Khan
2025-11-07  4:34   ` HariKrishna Sagala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).