Commit 4a9c380d authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[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.
parent 0b460a61
...@@ -53,8 +53,12 @@ postcore_initcall(pcibus_class_init); ...@@ -53,8 +53,12 @@ postcore_initcall(pcibus_class_init);
static ssize_t pci_bus_show_cpuaffinity(struct class_device *class_dev, char *buf) 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); 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); static CLASS_DEVICE_ATTR(cpuaffinity, S_IRUGO, pci_bus_show_cpuaffinity, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment