platform/mellanox: mlxreg-io: use sysfs_emit() instead of sprintf()
authorAi Chao <aichao@kylinos.cn>
Thu, 16 Jan 2025 08:11:29 +0000 (16:11 +0800)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 20 Jan 2025 12:13:22 +0000 (14:13 +0200)
commitff44b1ca889f9ddc401daf375f8ee15a16f6d394
treeba6b6a9f82f34e668a8b920b71fa188f22544d0b
parentfcf1b6f8d8248b4c79e5f7c506010d389f1e4f16
platform/mellanox: mlxreg-io: use sysfs_emit() instead of sprintf()

Follow the advice in Documentation/filesystems/sysfs.rst:
show() should only use sysfs_emit() or sysfs_emit_at() when formatting
the value to be returned to user space.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
Acked-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20250116081129.2902274-1-aichao@kylinos.cn
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/mellanox/mlxreg-io.c