ALSA: pcm: Replace sprintf() with sysfs_emit()

For sysfs outputs, it's safer to use a new helper, sysfs_emit(),
instead of the raw sprintf() & co.  This patch replaces such a
sprintf() call straightforwardly with the new helper.

Link: https://lore.kernel.org/r/20220801165639.26030-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2022-08-01 18:56:37 +02:00
parent 0031812bd8
commit 01043e3e14
1 changed files with 1 additions and 1 deletions

View File

@ -1031,7 +1031,7 @@ static ssize_t pcm_class_show(struct device *dev,
str = "none"; str = "none";
else else
str = strs[pcm->dev_class]; str = strs[pcm->dev_class];
return sprintf(buf, "%s\n", str); return sysfs_emit(buf, "%s\n", str);
} }
static DEVICE_ATTR_RO(pcm_class); static DEVICE_ATTR_RO(pcm_class);