aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-04-08 14:43:03 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-19 13:44:59 -0400
commit39106dcf85285e78f3b290022122c76f851379b8 (patch)
tree7fe93aaf6a433920b1c31725f42db30799deaa55 /drivers/pci/probe.c
parentfb0f330e62d71f7c535251438068199af320cf73 (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/probe.c')
-rw-r--r--drivers/pci/probe.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 2db2e4bb0d1e..4b3011a23eff 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -82,6 +82,7 @@ void pci_remove_legacy_files(struct pci_bus *bus) { return; }
82 * PCI Bus Class Devices 82 * PCI Bus Class Devices
83 */ 83 */
84static ssize_t pci_bus_show_cpuaffinity(struct device *dev, 84static ssize_t pci_bus_show_cpuaffinity(struct device *dev,
85 int type,
85 struct device_attribute *attr, 86 struct device_attribute *attr,
86 char *buf) 87 char *buf)
87{ 88{
@@ -89,12 +90,30 @@ static ssize_t pci_bus_show_cpuaffinity(struct device *dev,
89 cpumask_t cpumask; 90 cpumask_t cpumask;
90 91
91 cpumask = pcibus_to_cpumask(to_pci_bus(dev)); 92 cpumask = pcibus_to_cpumask(to_pci_bus(dev));
92 ret = cpumask_scnprintf(buf, PAGE_SIZE, cpumask); 93 ret = type?
93 if (ret < PAGE_SIZE) 94 cpulist_scnprintf(buf, PAGE_SIZE-2, cpumask):
94 buf[ret++] = '\n'; 95 cpumask_scnprintf(buf, PAGE_SIZE-2, cpumask);
96 buf[ret++] = '\n';
97 buf[ret] = '\0';
95 return ret; 98 return ret;
96} 99}
97DEVICE_ATTR(cpuaffinity, S_IRUGO, pci_bus_show_cpuaffinity, NULL); 100
101static ssize_t inline pci_bus_show_cpumaskaffinity(struct device *dev,
102 struct device_attribute *attr,
103 char *buf)
104{
105 return pci_bus_show_cpuaffinity(dev, 0, attr, buf);
106}
107
108static ssize_t inline pci_bus_show_cpulistaffinity(struct device *dev,
109 struct device_attribute *attr,
110 char *buf)
111{
112 return pci_bus_show_cpuaffinity(dev, 1, attr, buf);
113}
114
115DEVICE_ATTR(cpuaffinity, S_IRUGO, pci_bus_show_cpumaskaffinity, NULL);
116DEVICE_ATTR(cpulistaffinity, S_IRUGO, pci_bus_show_cpulistaffinity, NULL);
98 117
99/* 118/*
100 * PCI Bus Class 119 * PCI Bus Class