All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 1/7] ALSA: ac97: Replace sprintf() with sysfs_emit()
Date: Mon,  1 Aug 2022 18:56:33 +0200	[thread overview]
Message-ID: <20220801165639.26030-2-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 the open code
straightforwardly with a new helper.

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

diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c
index 0d31a6d71468..045330883a96 100644
--- a/sound/ac97/bus.c
+++ b/sound/ac97/bus.c
@@ -460,7 +460,7 @@ static ssize_t vendor_id_show(struct device *dev,
 {
 	struct ac97_codec_device *codec = to_ac97_device(dev);
 
-	return sprintf(buf, "%08x", codec->vendor_id);
+	return sysfs_emit(buf, "%08x", codec->vendor_id);
 }
 DEVICE_ATTR_RO(vendor_id);
 
-- 
2.35.3


  reply	other threads:[~2022-08-01 16:57 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 ` Takashi Iwai [this message]
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 ` [PATCH 5/7] ALSA: pcm: Replace sprintf() " Takashi Iwai
2022-08-01 16:56 ` [PATCH 6/7] ALSA: hda: " 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-2-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.