From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Cc: matthew@wil.cx
Subject: [PATCH] PCI busses are structs, not integers
Date: Fri, 1 Apr 2005 15:47:52 -0800 [thread overview]
Message-ID: <11123992723300@kroah.com> (raw)
In-Reply-To: <11123992711084@kroah.com>
ChangeSet 1.2181.16.13, 2005/03/17 14:31:48-08:00, matthew@wil.cx
[PATCH] PCI busses are structs, not integers
PCI busses are structs, not integers. Fix pcibus_to_cpumask to take
a struct. NB changing it from a macro to an inline function would
require serious include file surgery.
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86_64/kernel/pci-gart.c | 2 +-
drivers/pci/pci-sysfs.c | 2 +-
drivers/pci/probe.c | 2 +-
include/asm-i386/topology.h | 7 ++++---
include/asm-x86_64/topology.h | 3 +--
5 files changed, 8 insertions(+), 8 deletions(-)
diff -Nru a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
--- a/arch/x86_64/kernel/pci-gart.c 2005-04-01 15:35:55 -08:00
+++ b/arch/x86_64/kernel/pci-gart.c 2005-04-01 15:35:55 -08:00
@@ -193,7 +193,7 @@
int node;
if (dev->bus == &pci_bus_type) {
cpumask_t mask;
- mask = pcibus_to_cpumask(to_pci_dev(dev)->bus->number);
+ mask = pcibus_to_cpumask(to_pci_dev(dev)->bus);
node = cpu_to_node(first_cpu(mask));
} else
node = numa_node_id();
diff -Nru a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
--- a/drivers/pci/pci-sysfs.c 2005-04-01 15:35:55 -08:00
+++ b/drivers/pci/pci-sysfs.c 2005-04-01 15:35:55 -08:00
@@ -46,7 +46,7 @@
static ssize_t local_cpus_show(struct device *dev, char *buf)
{
- cpumask_t mask = pcibus_to_cpumask(to_pci_dev(dev)->bus->number);
+ cpumask_t mask = pcibus_to_cpumask(to_pci_dev(dev)->bus);
int len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
strcat(buf,"\n");
return 1+len;
diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c 2005-04-01 15:35:55 -08:00
+++ b/drivers/pci/probe.c 2005-04-01 15:35:55 -08:00
@@ -80,7 +80,7 @@
*/
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));
int ret;
ret = cpumask_scnprintf(buf, PAGE_SIZE, cpumask);
diff -Nru a/include/asm-i386/topology.h b/include/asm-i386/topology.h
--- a/include/asm-i386/topology.h 2005-04-01 15:35:55 -08:00
+++ b/include/asm-i386/topology.h 2005-04-01 15:35:55 -08:00
@@ -60,11 +60,12 @@
return first_cpu(mask);
}
-/* Returns the number of the node containing PCI bus 'bus' */
-static inline cpumask_t pcibus_to_cpumask(int bus)
+/* Returns the number of the node containing PCI bus number 'busnr' */
+static inline cpumask_t __pcibus_to_cpumask(int busnr)
{
- return node_to_cpumask(mp_bus_id_to_node[bus]);
+ return node_to_cpumask(mp_bus_id_to_node[busnr]);
}
+#define pcibus_to_cpumask(bus) __pcibus_to_cpumask(bus->number)
/* sched_domains SD_NODE_INIT for NUMAQ machines */
#define SD_NODE_INIT (struct sched_domain) { \
diff -Nru a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
--- a/include/asm-x86_64/topology.h 2005-04-01 15:35:55 -08:00
+++ b/include/asm-x86_64/topology.h 2005-04-01 15:35:55 -08:00
@@ -35,8 +35,7 @@
cpus_and(res, busmask, online);
return res;
}
-/* broken generic file uses #ifndef later on this */
-#define pcibus_to_cpumask(bus) __pcibus_to_cpumask(bus)
+#define pcibus_to_cpumask(bus) __pcibus_to_cpumask(bus->number)
#ifdef CONFIG_NUMA
/* sched_domains SD_NODE_INIT for x86_64 machines */
next prev parent reply other threads:[~2005-04-01 23:55 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-01 23:45 [BK PATCH] PCI update for 2.6.12-rc1 Greg KH
2005-04-01 23:47 ` PCI: increase the size of the pci.ids strings Greg KH
2005-04-01 23:47 ` Remove item from feature-removal-schedule.txt that was already removed from the kernel Greg KH
2005-04-01 23:47 ` PCI: add CONFIG_PCI_NAMES to the feature-removal-schedule.txt file Greg KH
2005-04-01 23:47 ` [PATCH] PCI: sync up with the latest pci.ids file from sf.net Greg KH
2005-04-01 23:47 ` [PATCH] PCI: Add PCI device ID for new Mellanox HCA Greg KH
2005-04-01 23:47 ` [PATCH] PCI: Patch for Serverworks chips in hotplug environment Greg KH
2005-04-01 23:47 ` PCI: fix an oops in some pci devices on hotplug remove when their resources are being freed Greg KH
2005-04-01 23:47 ` [PATCH] PCI: trivial DBG tidy-up Greg KH
2005-04-01 23:47 ` [PATCH] PCI Hotplug: remove code duplication in drivers/pci/hotplug/ibmphp_pci.c Greg KH
2005-04-01 23:47 ` [PATCH] PCI Hotplug: only call ibmphp_remove_resource() if argument is not NULL Greg KH
2005-04-01 23:47 ` [PATCH] PCI: 80 column lines Greg KH
2005-04-01 23:47 ` [PATCH] [PATCH] remove redundant devices list Greg KH
2005-04-01 23:47 ` Greg KH [this message]
2005-04-01 23:47 ` [PATCH] pci_ids.h correction for Intel ICH7M Greg KH
2005-04-01 23:47 ` [PATCH] sort-out-pci_rom_address_enable-vs-ioresource_rom_enable.patch Greg KH
2005-04-01 23:47 ` [PATCH] arch/i386/pci/i386.c: Use new for_each_pci_dev macro Greg KH
2005-04-01 23:47 ` PCI Hotplug: enforce the rule that a hotplug slot needs a release function Greg KH
2005-04-01 23:47 ` [PATCH] PCI Hotplug: add documentation about release pointer Greg KH
2005-04-01 23:47 ` [PATCH] PCI: Quirk for Asus M5N Greg KH
2005-04-01 23:47 ` [PATCH] drivers/pci/hotplug/cpqphp_core.c: fix a check after use Greg KH
2005-04-01 23:47 ` [PATCH] PCI: shrink drivers/pci/proc.c::pci_seq_start() Greg KH
2005-04-01 23:47 ` [PATCH] PCI: handle multiple video cards on the same bus Greg KH
2005-04-01 23:47 ` [PATCH] PCI: remove pci_find_device usage from pci sysfs code Greg KH
2005-04-01 23:47 ` [PATCH] drivers/pci/msi.c: fix a check after use Greg KH
2005-04-01 23:47 ` PCI: clean up the dynamic id logic a little bit Greg KH
2005-04-01 23:47 ` [PATCH] PCI: create PCI_DEBUG config option to make it easier for users to enable pci debugging Greg KH
2005-04-02 12:20 ` [PATCH] PCI Hotplug: remove code duplication in drivers/pci/hotplug/ibmphp_pci.c Rolf Eike Beer
2005-04-02 19:26 ` Andrew Morton
2005-04-08 0:07 ` Greg KH
2005-04-08 7:02 ` Rolf Eike Beer
2005-04-02 1:10 ` PCI: fix an oops in some pci devices on hotplug remove when their resources are being freed Matthew Wilcox
2005-04-02 3:31 ` Greg KH
2005-04-02 3:53 ` Matthew Wilcox
2005-04-02 4:04 ` Greg KH
2005-04-04 20:11 ` PCI: increase the size of the pci.ids strings Giuseppe Bilotta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11123992723300@kroah.com \
--to=gregkh@suse.de \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=matthew@wil.cx \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox