Skip to content

Commit ff44b1c

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/mellanox/mlxreg-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ mlxreg_io_attr_show(struct device *dev, struct device_attribute *attr,
126126

127127
mutex_unlock(&priv->io_lock);
128128

129-
return sprintf(buf, "%u\n", regval);
129+
return sysfs_emit(buf, "%u\n", regval);
130130

131131
access_error:
132132
mutex_unlock(&priv->io_lock);

0 commit comments

Comments
 (0)