summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/perf_event_amd_uncore.c
diff options
context:
space:
mode:
authorSudeep Holla2014-09-30 15:48:22 +0200
committerGreg Kroah-Hartman2014-11-07 20:45:00 +0100
commit5aaba36318e5995e8c95d077a46d9a4d00fcc1cd (patch)
treeedf9eb1ea758b82f1f04963a0fc54fab8bc8bc50 /arch/x86/kernel/cpu/perf_event_amd_uncore.c
parentdriver core: Fix unbalanced device reference in drivers_probe (diff)
downloadkernel-qcow2-linux-5aaba36318e5995e8c95d077a46d9a4d00fcc1cd.tar.gz
kernel-qcow2-linux-5aaba36318e5995e8c95d077a46d9a4d00fcc1cd.tar.xz
kernel-qcow2-linux-5aaba36318e5995e8c95d077a46d9a4d00fcc1cd.zip
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_uncore.c')
-rw-r--r--arch/x86/kernel/cpu/perf_event_amd_uncore.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_amd_uncore.c b/arch/x86/kernel/cpu/perf_event_amd_uncore.c
index 30790d798e6b..cc6cedb8f25d 100644
--- a/arch/x86/kernel/cpu/perf_event_amd_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_amd_uncore.c
@@ -219,7 +219,6 @@ static ssize_t amd_uncore_attr_show_cpumask(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- int n;
cpumask_t *active_mask;
struct pmu *pmu = dev_get_drvdata(dev);
@@ -230,10 +229,7 @@ static ssize_t amd_uncore_attr_show_cpumask(struct device *dev,
else
return 0;
- n = cpulist_scnprintf(buf, PAGE_SIZE - 2, active_mask);
- buf[n++] = '\n';
- buf[n] = '\0';
- return n;
+ return cpumap_print_to_pagebuf(true, buf, active_mask);
}
static DEVICE_ATTR(cpumask, S_IRUGO, amd_uncore_attr_show_cpumask, NULL);