diff mbox series

[5/8] ASoC: Intel: skylake: Replace sprintf() with sysfs_emit()

Message ID 20220801170108.26340-6-tiwai@suse.de
State Accepted
Commit 11af2b1e33e8c9e72ddf14cd61f9494f34e06c40
Headers show
Series ASoC: Replace sprintf() with sysfs_emit() | expand

Commit Message

Takashi Iwai Aug. 1, 2022, 5:01 p.m. UTC
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/skylake/skl-nhlt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Cezary Rojewski Aug. 2, 2022, 10:17 a.m. UTC | #1
On 2022-08-01 7:01 PM, Takashi Iwai wrote:
> 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().

Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
diff mbox series

Patch

diff --git a/sound/soc/intel/skylake/skl-nhlt.c b/sound/soc/intel/skylake/skl-nhlt.c
index deb7b820325e..e617b4c335a4 100644
--- a/sound/soc/intel/skylake/skl-nhlt.c
+++ b/sound/soc/intel/skylake/skl-nhlt.c
@@ -61,7 +61,7 @@  static ssize_t platform_id_show(struct device *dev,
 			nhlt->header.oem_revision);
 
 	skl_nhlt_trim_space(platform_id);
-	return sprintf(buf, "%s\n", platform_id);
+	return sysfs_emit(buf, "%s\n", platform_id);
 }
 
 static DEVICE_ATTR_RO(platform_id);