Skip to content

Commit 0031812

Browse files
committed
ALSA: core: Replace scnprintf() with sysfs_emit()
sysfs_emit() is a new helper to simplify the sysfs string output. Replace the open-code with this new helper. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent ade7956 commit 0031812

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/core/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ static ssize_t id_show(struct device *dev,
784784
struct device_attribute *attr, char *buf)
785785
{
786786
struct snd_card *card = container_of(dev, struct snd_card, card_dev);
787-
return scnprintf(buf, PAGE_SIZE, "%s\n", card->id);
787+
return sysfs_emit(buf, "%s\n", card->id);
788788
}
789789

790790
static ssize_t id_store(struct device *dev, struct device_attribute *attr,
@@ -822,7 +822,7 @@ static ssize_t number_show(struct device *dev,
822822
struct device_attribute *attr, char *buf)
823823
{
824824
struct snd_card *card = container_of(dev, struct snd_card, card_dev);
825-
return scnprintf(buf, PAGE_SIZE, "%i\n", card->number);
825+
return sysfs_emit(buf, "%i\n", card->number);
826826
}
827827

828828
static DEVICE_ATTR_RO(number);

0 commit comments

Comments
 (0)