diff options
author | Mike Travis <travis@sgi.com> | 2008-04-08 14:43:03 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:44:59 -0400 |
commit | 39106dcf85285e78f3b290022122c76f851379b8 (patch) | |
tree | 7fe93aaf6a433920b1c31725f42db30799deaa55 /drivers/pci/pci-sysfs.c | |
parent | fb0f330e62d71f7c535251438068199af320cf73 (diff) |
cpumask: use new cpus_scnprintf function
* Cleaned up references to cpumask_scnprintf() and added new
cpulist_scnprintf() interfaces where appropriate.
* Fix some small bugs (or code efficiency improvments) for various uses
of cpumask_scnprintf.
* Clean up some checkpatch errors.
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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 8dcf1458aa2f..8d9d648daeba 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -73,8 +73,23 @@ static ssize_t local_cpus_show(struct device *dev, | |||
73 | 73 | ||
74 | mask = pcibus_to_cpumask(to_pci_dev(dev)->bus); | 74 | mask = pcibus_to_cpumask(to_pci_dev(dev)->bus); |
75 | len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask); | 75 | len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask); |
76 | strcat(buf,"\n"); | 76 | buf[len++] = '\n'; |
77 | return 1+len; | 77 | buf[len] = '\0'; |
78 | return len; | ||
79 | } | ||
80 | |||
81 | |||
82 | static ssize_t local_cpulist_show(struct device *dev, | ||
83 | struct device_attribute *attr, char *buf) | ||
84 | { | ||
85 | cpumask_t mask; | ||
86 | int len; | ||
87 | |||
88 | mask = pcibus_to_cpumask(to_pci_dev(dev)->bus); | ||
89 | len = cpulist_scnprintf(buf, PAGE_SIZE-2, mask); | ||
90 | buf[len++] = '\n'; | ||
91 | buf[len] = '\0'; | ||
92 | return len; | ||
78 | } | 93 | } |
79 | 94 | ||
80 | /* show resources */ | 95 | /* show resources */ |
@@ -201,6 +216,7 @@ struct device_attribute pci_dev_attrs[] = { | |||
201 | __ATTR_RO(class), | 216 | __ATTR_RO(class), |
202 | __ATTR_RO(irq), | 217 | __ATTR_RO(irq), |
203 | __ATTR_RO(local_cpus), | 218 | __ATTR_RO(local_cpus), |
219 | __ATTR_RO(local_cpulist), | ||
204 | __ATTR_RO(modalias), | 220 | __ATTR_RO(modalias), |
205 | #ifdef CONFIG_NUMA | 221 | #ifdef CONFIG_NUMA |
206 | __ATTR_RO(numa_node), | 222 | __ATTR_RO(numa_node), |