diff options
author | Chen Zhou <chenzhou10@huawei.com> | 2020-05-09 11:18:49 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-14 00:35:58 +0200 |
commit | 117e2cb3eeee2940ba581d104951f6207cb46ce5 (patch) | |
tree | 73d8849b942454df345de2b5243ad644e6694093 /arch/sparc | |
parent | sparc: use scnprintf() in show_pciobppath_attr() in pci.c (diff) | |
download | linux-117e2cb3eeee2940ba581d104951f6207cb46ce5.tar.xz linux-117e2cb3eeee2940ba581d104951f6207cb46ce5.zip |
sparc: use scnprintf() in show_pciobppath_attr() in vio.c
snprintf() returns the number of bytes that would be written,
which may be greater than the the actual length to be written.
show_pciobppath_attr() should return the number of bytes printed
into the buffer. This is the return value of scnprintf().
Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/vio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c index c7cad9b7bba7..4f57056ed463 100644 --- a/arch/sparc/kernel/vio.c +++ b/arch/sparc/kernel/vio.c @@ -193,7 +193,7 @@ show_pciobppath_attr(struct device *dev, struct device_attribute *attr, vdev = to_vio_dev(dev); dp = vdev->dp; - return snprintf (buf, PAGE_SIZE, "%pOF\n", dp); + return scnprintf(buf, PAGE_SIZE, "%pOF\n", dp); } static DEVICE_ATTR(obppath, S_IRUSR | S_IRGRP | S_IROTH, |