diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2013-06-05 10:08:07 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-06-26 15:10:09 -0400 |
commit | 80b054ba2ab1c46e6c34c6a54f542d8f7ad77fca (patch) | |
tree | e7e597e10d35077b639598fd7baea3bfa72885d7 /arch/s390/pci | |
parent | 8b2a7e609bfcb26ed3639da9eda3fea42c009b65 (diff) |
s390/pci: sysfs remove strlen
Get rid of the strlen calls, use the return value of sprintf instead.
Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/pci')
-rw-r--r-- | arch/s390/pci/pci_sysfs.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/s390/pci/pci_sysfs.c b/arch/s390/pci/pci_sysfs.c index f9bad5aa5922..e99a2557f186 100644 --- a/arch/s390/pci/pci_sysfs.c +++ b/arch/s390/pci/pci_sysfs.c | |||
@@ -17,8 +17,7 @@ static ssize_t show_fid(struct device *dev, struct device_attribute *attr, | |||
17 | { | 17 | { |
18 | struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); | 18 | struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); |
19 | 19 | ||
20 | sprintf(buf, "0x%08x\n", zdev->fid); | 20 | return sprintf(buf, "0x%08x\n", zdev->fid); |
21 | return strlen(buf); | ||
22 | } | 21 | } |
23 | static DEVICE_ATTR(function_id, S_IRUGO, show_fid, NULL); | 22 | static DEVICE_ATTR(function_id, S_IRUGO, show_fid, NULL); |
24 | 23 | ||
@@ -27,8 +26,7 @@ static ssize_t show_fh(struct device *dev, struct device_attribute *attr, | |||
27 | { | 26 | { |
28 | struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); | 27 | struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); |
29 | 28 | ||
30 | sprintf(buf, "0x%08x\n", zdev->fh); | 29 | return sprintf(buf, "0x%08x\n", zdev->fh); |
31 | return strlen(buf); | ||
32 | } | 30 | } |
33 | static DEVICE_ATTR(function_handle, S_IRUGO, show_fh, NULL); | 31 | static DEVICE_ATTR(function_handle, S_IRUGO, show_fh, NULL); |
34 | 32 | ||
@@ -37,8 +35,7 @@ static ssize_t show_pchid(struct device *dev, struct device_attribute *attr, | |||
37 | { | 35 | { |
38 | struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); | 36 | struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); |
39 | 37 | ||
40 | sprintf(buf, "0x%04x\n", zdev->pchid); | 38 | return sprintf(buf, "0x%04x\n", zdev->pchid); |
41 | return strlen(buf); | ||
42 | } | 39 | } |
43 | static DEVICE_ATTR(pchid, S_IRUGO, show_pchid, NULL); | 40 | static DEVICE_ATTR(pchid, S_IRUGO, show_pchid, NULL); |
44 | 41 | ||
@@ -47,8 +44,7 @@ static ssize_t show_pfgid(struct device *dev, struct device_attribute *attr, | |||
47 | { | 44 | { |
48 | struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); | 45 | struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); |
49 | 46 | ||
50 | sprintf(buf, "0x%02x\n", zdev->pfgid); | 47 | return sprintf(buf, "0x%02x\n", zdev->pfgid); |
51 | return strlen(buf); | ||
52 | } | 48 | } |
53 | static DEVICE_ATTR(pfgid, S_IRUGO, show_pfgid, NULL); | 49 | static DEVICE_ATTR(pfgid, S_IRUGO, show_pfgid, NULL); |
54 | 50 | ||