Merge branch 'sparc-scnprintf'
Chen Zhou says: ==================== sparc: use scnprintf() in show() methods snprintf() returns the number of bytes that would be written, which may be greater than the the actual length to be written. show() methods should return the number of bytes printed into the buffer. This is the return value of scnprintf(). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Коммит
fcdf818d23
|
@ -593,7 +593,7 @@ show_pciobppath_attr(struct device * dev, struct device_attribute * attr, char *
|
|||
pdev = to_pci_dev(dev);
|
||||
dp = pdev->dev.of_node;
|
||||
|
||||
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, show_pciobppath_attr, NULL);
|
||||
|
|
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче