summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/perf_event_amd_iommu.c
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2014-09-30 13:48:22 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-07 19:45:00 (GMT)
commit5aaba36318e5995e8c95d077a46d9a4d00fcc1cd (patch)
treeedf9eb1ea758b82f1f04963a0fc54fab8bc8bc50 /arch/x86/kernel/cpu/perf_event_amd_iommu.c
parent0372ffb35d00288802265586a29c117911d02fb8 (diff)
downloadlinux-5aaba36318e5995e8c95d077a46d9a4d00fcc1cd.tar.xz
cpumask: factor out show_cpumap into separate helper function
Many sysfs *_show function use cpu{list,mask}_scnprintf to copy cpumap to the buffer aligned to PAGE_SIZE, append '\n' and '\0' to return null terminated buffer with newline. This patch creates a new helper function cpumap_print_to_pagebuf in cpumask.h using newly added bitmap_print_to_pagebuf and consolidates most of those sysfs functions using the new helper function. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Suggested-by: Stephen Boyd <sboyd@codeaurora.org> Tested-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: "Rafael J. Wysocki" <rjw@rjwysocki.net> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: x86@kernel.org Cc: linux-acpi@vger.kernel.org Cc: linux-pci@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event_amd_iommu.c')
-rw-r--r--arch/x86/kernel/cpu/perf_event_amd_iommu.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_amd_iommu.c b/arch/x86/kernel/cpu/perf_event_amd_iommu.c
index 639d128..97242a9 100644
--- a/arch/x86/kernel/cpu/perf_event_amd_iommu.c
+++ b/arch/x86/kernel/cpu/perf_event_amd_iommu.c
@@ -130,10 +130,7 @@ static ssize_t _iommu_cpumask_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- int n = cpulist_scnprintf(buf, PAGE_SIZE - 2, &iommu_cpumask);
- buf[n++] = '\n';
- buf[n] = '\0';
- return n;
+ return cpumap_print_to_pagebuf(true, buf, &iommu_cpumask);
}
static DEVICE_ATTR(cpumask, S_IRUGO, _iommu_cpumask_show, NULL);