Skip to contentSkip to conversation

ALSA: hda/tegra: Switch to two-argument strscpy()

PATCH In review Daniel Dadap 2 participants 2 messages May 21, 2025

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

PATCH 1/1 ALSA: hda/tegra: Switch to two-argument strscpy()

strscpy() is used in this driver with char[] struct member destinations, so it is possible to use the simplified two-argument variant which was added by commit e6584c3964f2 ("string: Allow 2-argument strscpy()").

---
 sound/pci/hda/hda_tegra.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/hda/hda_tegra.c +2 -2
index a590d431c5ff..c23da6ebef50 100644
@@ -377,14 +377,14 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev)
 	}
 
 	/* driver name */
-	strscpy(card->driver, drv_name, sizeof(card->driver));
+	strscpy(card->driver, drv_name);
 	/* shortname for card */
 	sname = of_get_property(np, "nvidia,model", NULL);
 	if (!sname)
 		sname = drv_name;
 	if (strlen(sname) > sizeof(card->shortname))
 		dev_info(card->dev, "truncating shortname for card\n");
-	strscpy(card->shortname, sname, sizeof(card->shortname));
+	strscpy(card->shortname, sname);
 
 	/* longname for card */
 	snprintf(card->longname, sizeof(card->longname),
Signature · 1 line
2.39.5
#1 lore raw
Quoted 6 lines · Daniel Dadap

strscpy() is used in this driver with char[] struct member destinations, so it is possible to use the simplified two-argument variant which was added by commit e6584c3964f2 ("string: Allow 2-argument strscpy()").

Applied now. Thanks.

Takashi