diff options
author | 2025-01-16 16:10:00 +0800 | |
---|---|---|
committer | 2025-01-20 14:13:20 +0200 | |
commit | fcf1b6f8d8248b4c79e5f7c506010d389f1e4f16 (patch) | |
tree | 9ae2166e85ffb9d236f11587c50955494139721f | |
parent | platform/mellanox: mlxbf-bootctl: use sysfs_emit() instead of sprintf() (diff) | |
download | wireguard-linux-fcf1b6f8d8248b4c79e5f7c506010d389f1e4f16.tar.xz wireguard-linux-fcf1b6f8d8248b4c79e5f7c506010d389f1e4f16.zip |
platform/mellanox: mlxreg-hotplug: 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/20250116081000.2900435-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>
Diffstat (limited to '')
-rw-r--r-- | drivers/platform/mellanox/mlxreg-hotplug.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c index 6aa2a4650367..b347000e4329 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -232,7 +232,7 @@ static ssize_t mlxreg_hotplug_attr_show(struct device *dev, regval = !!(regval & data->mask); } - return sprintf(buf, "%u\n", regval); + return sysfs_emit(buf, "%u\n", regval); } #define PRIV_ATTR(i) priv->mlxreg_hotplug_attr[i] |