diff options
author | Takashi Iwai <tiwai@suse.de> | 2022-08-01 19:56:39 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2022-08-02 17:03:49 +0300 |
commit | 6c955a9d9dbc0282a9aa14064fe456a10ee92fc6 (patch) | |
tree | f29b020fa287108a60905f3e8a3f7d004c52d3a8 /sound/usb | |
parent | 17daae7ac47aa870e7042aa7eeaff987feab92c6 (diff) | |
download | linux-6c955a9d9dbc0282a9aa14064fe456a10ee92fc6.tar.xz |
ALSA: line6: 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 those usages
straightforwardly with a new helper, sysfs_emit().
Link: https://lore.kernel.org/r/20220801165639.26030-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/line6/pod.c | 8 | ||||
-rw-r--r-- | sound/usb/line6/podhd.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c index 16e644330c4d..cd41aa7f0385 100644 --- a/sound/usb/line6/pod.c +++ b/sound/usb/line6/pod.c @@ -235,7 +235,7 @@ static ssize_t serial_number_show(struct device *dev, struct snd_card *card = dev_to_snd_card(dev); struct usb_line6_pod *pod = card->private_data; - return sprintf(buf, "%u\n", pod->serial_number); + return sysfs_emit(buf, "%u\n", pod->serial_number); } /* @@ -247,8 +247,8 @@ static ssize_t firmware_version_show(struct device *dev, struct snd_card *card = dev_to_snd_card(dev); struct usb_line6_pod *pod = card->private_data; - return sprintf(buf, "%d.%02d\n", pod->firmware_version / 100, - pod->firmware_version % 100); + return sysfs_emit(buf, "%d.%02d\n", pod->firmware_version / 100, + pod->firmware_version % 100); } /* @@ -260,7 +260,7 @@ static ssize_t device_id_show(struct device *dev, struct snd_card *card = dev_to_snd_card(dev); struct usb_line6_pod *pod = card->private_data; - return sprintf(buf, "%d\n", pod->device_id); + return sysfs_emit(buf, "%d\n", pod->device_id); } /* diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c index b24bc82f89e3..ffd8c157a281 100644 --- a/sound/usb/line6/podhd.c +++ b/sound/usb/line6/podhd.c @@ -146,7 +146,7 @@ static ssize_t serial_number_show(struct device *dev, struct snd_card *card = dev_to_snd_card(dev); struct usb_line6_podhd *pod = card->private_data; - return sprintf(buf, "%u\n", pod->serial_number); + return sysfs_emit(buf, "%u\n", pod->serial_number); } static ssize_t firmware_version_show(struct device *dev, @@ -155,7 +155,7 @@ static ssize_t firmware_version_show(struct device *dev, struct snd_card *card = dev_to_snd_card(dev); struct usb_line6_podhd *pod = card->private_data; - return sprintf(buf, "%06x\n", pod->firmware_version); + return sysfs_emit(buf, "%06x\n", pod->firmware_version); } static DEVICE_ATTR_RO(firmware_version); |