Skip to content

Commit fcf1b6f

Browse files
TomAi0ij-intel
authored andcommitted
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>
1 parent 9886f57 commit fcf1b6f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/platform/mellanox/mlxreg-hotplug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static ssize_t mlxreg_hotplug_attr_show(struct device *dev,
232232
regval = !!(regval & data->mask);
233233
}
234234

235-
return sprintf(buf, "%u\n", regval);
235+
return sysfs_emit(buf, "%u\n", regval);
236236
}
237237

238238
#define PRIV_ATTR(i) priv->mlxreg_hotplug_attr[i]

0 commit comments

Comments
 (0)