From 4a9c380d2bed9fc2dcb9c85b3e4c2807ad65d480 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 31 Jan 2004 20:49:23 -0800 Subject: [PATCH] [PATCH] fix the build for NR_CPUS > 4*BITS_PER_LONG You can't just cast cpumasks. It doesn't compile if NR_CPUS is greater than 4 * BITS_PER_LONG. --- drivers/pci/probe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 19c9f836e2f9c..7ff393b53a281 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -53,8 +53,12 @@ postcore_initcall(pcibus_class_init); static ssize_t pci_bus_show_cpuaffinity(struct class_device *class_dev, char *buf) { cpumask_t cpumask = pcibus_to_cpumask((to_pci_bus(class_dev))->number); + int ret; - return sprintf(buf, "%lx\n", (unsigned long)cpumask); + ret = cpumask_snprintf(buf, PAGE_SIZE, cpumask); + if (ret < PAGE_SIZE) + buf[ret++] = '\n'; + return ret; } static CLASS_DEVICE_ATTR(cpuaffinity, S_IRUGO, pci_bus_show_cpuaffinity, NULL); -- 2.53.0