]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix the build for NR_CPUS > 4*BITS_PER_LONG
authorAndrew Morton <akpm@osdl.org>
Sun, 1 Feb 2004 04:49:23 +0000 (20:49 -0800)
committerDavid S. Miller <davem@nuts.davemloft.net>
Sun, 1 Feb 2004 04:49:23 +0000 (20:49 -0800)
You can't just cast cpumasks.  It doesn't compile if NR_CPUS is greater than
4 * BITS_PER_LONG.

drivers/pci/probe.c

index 19c9f836e2f9cf98ae2497c616dd4a1b3eaf61dc..7ff393b53a28188b14af9c788b7ad0235feaee38 100644 (file)
@@ -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);