All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org,
	Lucas Tanure <tanureal@opensource.cirrus.com>,
	Cezary Rojewski <cezary.rojewski@intel.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Subject: [PATCH 6/8] ASoC: core: Replace sprintf() with sysfs_emit()
Date: Mon,  1 Aug 2022 19:01:06 +0200	[thread overview]
Message-ID: <20220801170108.26340-7-tiwai@suse.de> (raw)
In-Reply-To: <20220801170108.26340-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 sprintf()
usage straightforwardly with a new helper, sysfs_emit().

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

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e824ff1a9fc0..e020ab49cfb1 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -72,7 +72,7 @@ static ssize_t pmdown_time_show(struct device *dev,
 {
 	struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev);
 
-	return sprintf(buf, "%ld\n", rtd->pmdown_time);
+	return sysfs_emit(buf, "%ld\n", rtd->pmdown_time);
 }
 
 static ssize_t pmdown_time_store(struct device *dev,
-- 
2.35.3


  parent reply	other threads:[~2022-08-01 17:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01 17:01 [PATCH 0/8] ASoC: Replace sprintf() with sysfs_emit() Takashi Iwai
2022-08-01 17:01 ` [PATCH 1/8] ASoC: cs43130: Replace scnprintf() " Takashi Iwai
2022-08-01 17:01 ` [PATCH 2/8] ASoC: tlv320aic26: Replace sprintf() " Takashi Iwai
2022-08-01 17:01 ` [PATCH 3/8] ASoC: Intel: sst: " Takashi Iwai
2022-08-01 17:01 ` [PATCH 4/8] ASoC: Intel: catpt: " Takashi Iwai
2022-08-02 10:17   ` Cezary Rojewski
2022-08-01 17:01 ` [PATCH 5/8] ASoC: Intel: skylake: " Takashi Iwai
2022-08-02 10:17   ` Cezary Rojewski
2022-08-01 17:01 ` Takashi Iwai [this message]
2022-08-01 17:01 ` [PATCH 7/8] ASoC: DAPM: Replace sprintf() calls with sysfs_emit_at() Takashi Iwai
2022-08-01 17:01 ` [PATCH 8/8] ASoC: omap: Replace sprintf() with sysfs_emit() Takashi Iwai
2022-08-01 18:54   ` Péter Ujfalusi
2022-08-15 16:23 ` [PATCH 0/8] ASoC: " Mark Brown

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=20220801170108.26340-7-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=tanureal@opensource.cirrus.com \
    /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.