From f724e628010ad9902ca4588752cacebbf972dfa7 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Mon, 17 Feb 2025 19:27:46 +0800 Subject: [PATCH] ASoC: aw883xx: move from strlcpy with unused retval to strscpy Signed-off-by: Tao Huang Change-Id: I069ff709db267f88a6bb0c3af255837e02715349 --- sound/soc/codecs/aw883xx/aw883xx.c | 8 ++++---- sound/soc/codecs/aw883xx/aw_spin.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/aw883xx/aw883xx.c b/sound/soc/codecs/aw883xx/aw883xx.c index 5de9a62d7a58..6623b18f497a 100644 --- a/sound/soc/codecs/aw883xx/aw883xx.c +++ b/sound/soc/codecs/aw883xx/aw883xx.c @@ -965,12 +965,12 @@ static int aw883xx_profile_info(struct snd_kcontrol *kcontrol, prof_name = aw_dev_get_prof_name(aw883xx->aw_pa, count); if (prof_name == NULL) { - strlcpy(uinfo->value.enumerated.name, "null", + strscpy(uinfo->value.enumerated.name, "null", strlen("null") + 1); return 0; } - strlcpy(name, prof_name, sizeof(uinfo->value.enumerated.name)); + strscpy(name, prof_name, sizeof(uinfo->value.enumerated.name)); return 0; } @@ -1049,7 +1049,7 @@ static int aw883xx_switch_info(struct snd_kcontrol *kcontrol, if (uinfo->value.enumerated.item >= count) uinfo->value.enumerated.item = count - 1; - strlcpy(uinfo->value.enumerated.name, + strscpy(uinfo->value.enumerated.name, aw883xx_switch[uinfo->value.enumerated.item], strlen(aw883xx_switch[uinfo->value.enumerated.item]) + 1); @@ -1124,7 +1124,7 @@ static int aw883xx_monitor_switch_info(struct snd_kcontrol *kcontrol, if (uinfo->value.enumerated.item >= count) uinfo->value.enumerated.item = count - 1; - strlcpy(uinfo->value.enumerated.name, + strscpy(uinfo->value.enumerated.name, aw883xx_switch[uinfo->value.enumerated.item], strlen(aw883xx_switch[uinfo->value.enumerated.item]) + 1); diff --git a/sound/soc/codecs/aw883xx/aw_spin.c b/sound/soc/codecs/aw883xx/aw_spin.c index ef01db66a380..a838f6d686fc 100644 --- a/sound/soc/codecs/aw883xx/aw_spin.c +++ b/sound/soc/codecs/aw883xx/aw_spin.c @@ -627,7 +627,7 @@ static int aw_spin_info(struct snd_kcontrol *kcontrol, if (uinfo->value.enumerated.item >= count) uinfo->value.enumerated.item = count - 1; - strlcpy(uinfo->value.enumerated.name, + strscpy(uinfo->value.enumerated.name, aw_spin[uinfo->value.enumerated.item], strlen(aw_spin[uinfo->value.enumerated.item]) + 1);