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.
While at it, follow Linux kernel coding style and unify indentation
Reported-by: Jules Irenge <jbi.octave@gmail.com>
Reported-by: Joe Perches <joe@perches.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Thorsten Winkler <twinkler@linux.ibm.com>
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static ssize_t
lcs_portno_show (struct device *dev, struct device_attribute *attr, char *buf)
{
static ssize_t
lcs_portno_show (struct device *dev, struct device_attribute *attr, char *buf)
{
card = dev_get_drvdata(dev);
card = dev_get_drvdata(dev);
- return sprintf(buf, "%d\n", card->portno);
+ return sysfs_emit(buf, "%d\n", card->portno);
if (!cgdev)
return -ENODEV;
if (!cgdev)
return -ENODEV;
- return sprintf(buf, "%s\n", lcs_type[cgdev->cdev[0]->id.driver_info]);
+ return sysfs_emit(buf, "%s\n",
+ lcs_type[cgdev->cdev[0]->id.driver_info]);
}
static DEVICE_ATTR(type, 0444, lcs_type_show, NULL);
}
static DEVICE_ATTR(type, 0444, lcs_type_show, NULL);
card = dev_get_drvdata(dev);
card = dev_get_drvdata(dev);
- return card ? sprintf(buf, "%u\n", card->lancmd_timeout) : 0;
+ return card ? sysfs_emit(buf, "%u\n", card->lancmd_timeout) : 0;