diff options
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r-- | drivers/pci/pci-sysfs.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index ae9a7695be97..271d41cc05ab 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -74,8 +74,23 @@ static ssize_t local_cpus_show(struct device *dev, | |||
74 | 74 | ||
75 | mask = pcibus_to_cpumask(to_pci_dev(dev)->bus); | 75 | mask = pcibus_to_cpumask(to_pci_dev(dev)->bus); |
76 | len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask); | 76 | len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask); |
77 | strcat(buf,"\n"); | 77 | buf[len++] = '\n'; |
78 | return 1+len; | 78 | buf[len] = '\0'; |
79 | return len; | ||
80 | } | ||
81 | |||
82 | |||
83 | static ssize_t local_cpulist_show(struct device *dev, | ||
84 | struct device_attribute *attr, char *buf) | ||
85 | { | ||
86 | cpumask_t mask; | ||
87 | int len; | ||
88 | |||
89 | mask = pcibus_to_cpumask(to_pci_dev(dev)->bus); | ||
90 | len = cpulist_scnprintf(buf, PAGE_SIZE-2, mask); | ||
91 | buf[len++] = '\n'; | ||
92 | buf[len] = '\0'; | ||
93 | return len; | ||
79 | } | 94 | } |
80 | 95 | ||
81 | /* show resources */ | 96 | /* show resources */ |
@@ -202,6 +217,7 @@ struct device_attribute pci_dev_attrs[] = { | |||
202 | __ATTR_RO(class), | 217 | __ATTR_RO(class), |
203 | __ATTR_RO(irq), | 218 | __ATTR_RO(irq), |
204 | __ATTR_RO(local_cpus), | 219 | __ATTR_RO(local_cpus), |
220 | __ATTR_RO(local_cpulist), | ||
205 | __ATTR_RO(modalias), | 221 | __ATTR_RO(modalias), |
206 | #ifdef CONFIG_NUMA | 222 | #ifdef CONFIG_NUMA |
207 | __ATTR_RO(numa_node), | 223 | __ATTR_RO(numa_node), |