aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAi Chao <[email protected]>2025-01-16 08:11:29 +0000
committerIlpo Järvinen <[email protected]>2025-01-20 12:13:22 +0000
commitff44b1ca889f9ddc401daf375f8ee15a16f6d394 (patch)
treeba6b6a9f82f34e668a8b920b71fa188f22544d0b
parentplatform/mellanox: mlxreg-hotplug: use sysfs_emit() instead of sprintf() (diff)
downloadkernel-ff44b1ca889f9ddc401daf375f8ee15a16f6d394.tar.gz
kernel-ff44b1ca889f9ddc401daf375f8ee15a16f6d394.zip
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 <[email protected]> Acked-by: Vadim Pasternak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
-rw-r--r--drivers/platform/mellanox/mlxreg-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/mellanox/mlxreg-io.c b/drivers/platform/mellanox/mlxreg-io.c
index 595276206baf..97fefe6c38d1 100644
--- a/drivers/platform/mellanox/mlxreg-io.c
+++ b/drivers/platform/mellanox/mlxreg-io.c
@@ -126,7 +126,7 @@ mlxreg_io_attr_show(struct device *dev, struct device_attribute *attr,
mutex_unlock(&priv->io_lock);
- return sprintf(buf, "%u\n", regval);
+ return sysfs_emit(buf, "%u\n", regval);
access_error:
mutex_unlock(&priv->io_lock);