aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/p2pdma.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2021-07-06 10:56:25 -0500
committerBjorn Helgaas <bhelgaas@google.com>2021-07-06 10:56:25 -0500
commit7132700067f234d37c234e5d711bb49ea06d2352 (patch)
tree58e1cdcb9bb16bb9c8fbd2bb38c599fa4d460def /drivers/pci/p2pdma.c
parentMerge branch 'pci/resource' (diff)
parentPCI/sysfs: Add 'devspec' newline (diff)
downloadlinux-dev-7132700067f234d37c234e5d711bb49ea06d2352.tar.xz
linux-dev-7132700067f234d37c234e5d711bb49ea06d2352.zip
Merge branch 'pci/sysfs'
- Fix dsm_label_utf16s_to_utf8s() buffer overrun (Krzysztof Wilczyński) - Use sysfs_emit() and sysfs_emit_at() in "show" functions (Krzysztof Wilczyński) - Fix 'resource_alignment' newline issues (Krzysztof Wilczyński) - Add newline to 'devspec' sysfs file (Krzysztof Wilczyński) * pci/sysfs: PCI/sysfs: Add 'devspec' newline PCI/sysfs: Fix 'resource_alignment' newline issues PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions PCI/sysfs: Rely on lengths from scnprintf(), dsm_label_utf16s_to_utf8s() PCI/sysfs: Fix dsm_label_utf16s_to_utf8s() buffer overrun # Conflicts: # drivers/pci/p2pdma.c
Diffstat (limited to 'drivers/pci/p2pdma.c')
-rw-r--r--drivers/pci/p2pdma.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 69c25e71590a..50cdde3e9a8b 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -57,7 +57,7 @@ static ssize_t size_show(struct device *dev, struct device_attribute *attr,
size = gen_pool_size(p2pdma->pool);
rcu_read_unlock();
- return scnprintf(buf, PAGE_SIZE, "%zd\n", size);
+ return sysfs_emit(buf, "%zd\n", size);
}
static DEVICE_ATTR_RO(size);
@@ -74,7 +74,7 @@ static ssize_t available_show(struct device *dev, struct device_attribute *attr,
avail = gen_pool_avail(p2pdma->pool);
rcu_read_unlock();
- return scnprintf(buf, PAGE_SIZE, "%zd\n", avail);
+ return sysfs_emit(buf, "%zd\n", avail);
}
static DEVICE_ATTR_RO(available);
@@ -91,7 +91,7 @@ static ssize_t published_show(struct device *dev, struct device_attribute *attr,
published = p2pdma->p2pmem_published;
rcu_read_unlock();
- return scnprintf(buf, PAGE_SIZE, "%d\n", published);
+ return sysfs_emit(buf, "%d\n", published);
}
static DEVICE_ATTR_RO(published);