Commit d3f0c7fa authored by Thorsten Winkler's avatar Thorsten Winkler Committed by Paolo Abeni
Browse files

s390/lcs: 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.

While at it, follow Linux kernel coding style and unify indentation

Reported-by: default avatarJules Irenge <jbi.octave@gmail.com>
Reported-by: default avatarJoe Perches <joe@perches.com>
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 ebe14dad
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1906,7 +1906,7 @@ lcs_portno_show (struct device *dev, struct device_attribute *attr, char *buf)
	if (!card)
		return 0;

        return sprintf(buf, "%d\n", card->portno);
	return sysfs_emit(buf, "%d\n", card->portno);
}

/*
@@ -1956,7 +1956,8 @@ lcs_type_show(struct device *dev, struct device_attribute *attr, char *buf)
	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);
@@ -1968,7 +1969,7 @@ lcs_timeout_show(struct device *dev, struct device_attribute *attr, char *buf)

	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;
}

static ssize_t