Commit d585e4b7 authored by Thorsten Winkler's avatar Thorsten Winkler Committed by Paolo Abeni

s390/ctcm: Convert sysfs sprintf to sysfs_emit

Following the advice of the Documentation/filesystems/sysfs.rst.
All sysfs related show()-functions should only use sysfs_emit() or
sysfs_emit_at() when formatting the value to be returned to user space.
Reviewed-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarThorsten Winkler <twinkler@linux.ibm.com>
Signed-off-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 1a079f3e
...@@ -28,7 +28,7 @@ static ssize_t ctcm_buffer_show(struct device *dev, ...@@ -28,7 +28,7 @@ static ssize_t ctcm_buffer_show(struct device *dev,
if (!priv) if (!priv)
return -ENODEV; return -ENODEV;
return sprintf(buf, "%d\n", priv->buffer_size); return sysfs_emit(buf, "%d\n", priv->buffer_size);
} }
static ssize_t ctcm_buffer_write(struct device *dev, static ssize_t ctcm_buffer_write(struct device *dev,
...@@ -120,7 +120,7 @@ static ssize_t stats_show(struct device *dev, ...@@ -120,7 +120,7 @@ static ssize_t stats_show(struct device *dev,
if (!priv || gdev->state != CCWGROUP_ONLINE) if (!priv || gdev->state != CCWGROUP_ONLINE)
return -ENODEV; return -ENODEV;
ctcm_print_statistics(priv); ctcm_print_statistics(priv);
return sprintf(buf, "0\n"); return sysfs_emit(buf, "0\n");
} }
static ssize_t stats_write(struct device *dev, struct device_attribute *attr, static ssize_t stats_write(struct device *dev, struct device_attribute *attr,
...@@ -142,7 +142,7 @@ static ssize_t ctcm_proto_show(struct device *dev, ...@@ -142,7 +142,7 @@ static ssize_t ctcm_proto_show(struct device *dev,
if (!priv) if (!priv)
return -ENODEV; return -ENODEV;
return sprintf(buf, "%d\n", priv->protocol); return sysfs_emit(buf, "%d\n", priv->protocol);
} }
static ssize_t ctcm_proto_store(struct device *dev, static ssize_t ctcm_proto_store(struct device *dev,
...@@ -184,8 +184,8 @@ static ssize_t ctcm_type_show(struct device *dev, ...@@ -184,8 +184,8 @@ static ssize_t ctcm_type_show(struct device *dev,
if (!cgdev) if (!cgdev)
return -ENODEV; return -ENODEV;
return sprintf(buf, "%s\n", return sysfs_emit(buf, "%s\n",
ctcm_type[cgdev->cdev[0]->id.driver_info]); ctcm_type[cgdev->cdev[0]->id.driver_info]);
} }
static DEVICE_ATTR(buffer, 0644, ctcm_buffer_show, ctcm_buffer_write); static DEVICE_ATTR(buffer, 0644, ctcm_buffer_show, ctcm_buffer_write);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment