Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: Intel: sst: Replace sprintf() with sysfs_emit()

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>
Link: https://lore.kernel.org/r/20220801170108.26340-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Takashi Iwai and committed by
Mark Brown
0aab7bda 1218d67d

+4 -4
+4 -4
sound/soc/intel/atom/sst/sst.c
··· 242 242 243 243 if (ctx->fw_version.type == 0 && ctx->fw_version.major == 0 && 244 244 ctx->fw_version.minor == 0 && ctx->fw_version.build == 0) 245 - return sprintf(buf, "FW not yet loaded\n"); 245 + return sysfs_emit(buf, "FW not yet loaded\n"); 246 246 else 247 - return sprintf(buf, "v%02x.%02x.%02x.%02x\n", 248 - ctx->fw_version.type, ctx->fw_version.major, 249 - ctx->fw_version.minor, ctx->fw_version.build); 247 + return sysfs_emit(buf, "v%02x.%02x.%02x.%02x\n", 248 + ctx->fw_version.type, ctx->fw_version.major, 249 + ctx->fw_version.minor, ctx->fw_version.build); 250 250 251 251 } 252 252