All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 5/7] ALSA: pcm: Replace sprintf() with sysfs_emit()
Date: Mon,  1 Aug 2022 18:56:37 +0200	[thread overview]
Message-ID: <20220801165639.26030-6-tiwai@suse.de> (raw)
In-Reply-To: <20220801165639.26030-1-tiwai@suse.de>

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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/core/pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 2ac742035310..82925709fa12 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -1031,7 +1031,7 @@ static ssize_t pcm_class_show(struct device *dev,
 		str = "none";
 	else
 		str = strs[pcm->dev_class];
-	return sprintf(buf, "%s\n", str);
+	return sysfs_emit(buf, "%s\n", str);
 }
 
 static DEVICE_ATTR_RO(pcm_class);
-- 
2.35.3


  parent reply	other threads:[~2022-08-01 16:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01 16:56 [PATCH 0/7] ALSA: Replace sprintf() with sysfs_emit() Takashi Iwai
2022-08-01 16:56 ` [PATCH 1/7] ALSA: ac97: " Takashi Iwai
2022-08-01 16:56 ` [PATCH 2/7] ALSA: aoa: " Takashi Iwai
2022-08-01 16:56 ` [PATCH 3/7] ALSA: control-led: " Takashi Iwai
2022-08-01 16:56 ` [PATCH 4/7] ALSA: core: Replace scnprintf() " Takashi Iwai
2022-08-01 16:56 ` Takashi Iwai [this message]
2022-08-01 16:56 ` [PATCH 6/7] ALSA: hda: Replace sprintf() " Takashi Iwai
2022-08-01 16:56 ` [PATCH 7/7] ALSA: line6: " Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220801165639.26030-6-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.