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 4/8] ASoC: Intel: catpt: Replace sprintf() with sysfs_emit()
Date: Mon,  1 Aug 2022 19:01:04 +0200	[thread overview]
Message-ID: <20220801170108.26340-5-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 those usages
straightforwardly with a new helper, sysfs_emit().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/intel/catpt/sysfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/intel/catpt/sysfs.c b/sound/soc/intel/catpt/sysfs.c
index 1bdbcc04dc71..9b6d2d93a2e7 100644
--- a/sound/soc/intel/catpt/sysfs.c
+++ b/sound/soc/intel/catpt/sysfs.c
@@ -27,8 +27,8 @@ static ssize_t fw_version_show(struct device *dev,
 	if (ret)
 		return CATPT_IPC_ERROR(ret);
 
-	return sprintf(buf, "%d.%d.%d.%d\n", version.type, version.major,
-		       version.minor, version.build);
+	return sysfs_emit(buf, "%d.%d.%d.%d\n", version.type, version.major,
+			  version.minor, version.build);
 }
 static DEVICE_ATTR_RO(fw_version);
 
@@ -37,7 +37,7 @@ static ssize_t fw_info_show(struct device *dev,
 {
 	struct catpt_dev *cdev = dev_get_drvdata(dev);
 
-	return sprintf(buf, "%s\n", cdev->ipc.config.fw_info);
+	return sysfs_emit(buf, "%s\n", cdev->ipc.config.fw_info);
 }
 static DEVICE_ATTR_RO(fw_info);
 
-- 
2.35.3


  parent reply	other threads:[~2022-08-01 17:02 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 ` Takashi Iwai [this message]
2022-08-02 10:17   ` [PATCH 4/8] ASoC: Intel: catpt: " 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 ` [PATCH 6/8] ASoC: core: " Takashi Iwai
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-5-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.