[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250116081129.2902274-1-aichao@kylinos.cn>
Date: Thu, 16 Jan 2025 16:11:29 +0800
From: Ai Chao <aichao@...inos.cn>
To: hdegoede@...hat.com,
ilpo.jarvinen@...ux.intel.com,
vadimp@...dia.com,
platform-driver-x86@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Ai Chao <aichao@...inos.cn>
Subject: [PATCH] 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@...inos.cn>
---
drivers/platform/mellanox/mlxreg-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.47.1
Powered by blists - more mailing lists