]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.xen/801-pciback-no-pci_match_id.patch
Disable build of xen kernel.
[ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.xen / 801-pciback-no-pci_match_id.patch
1 From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/5b779f810966
2 # HG changeset 801 patch
3 # User Keir Fraser <keir.fraser@citrix.com>
4 # Date 1235991476 0
5 # Node ID 5b779f8109662803b7d292ef1effbf68be3319d2
6 # Parent ae2cf9ef03acd34c2fd747c924aa9660467055a1
7 Subject: pciback: Fix invalid use of pci_match_id()
8
9 We cannot use pci_match_id() because the first argument (tmp_quirk->devid)
10 is not an array of pci device ids. Instead this patch adds a utility
11 function to compare a pci_device_id and a pci_dev.
12
13 Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
14 Acked-by: jbeulich@novell.com
15
16 --- sle11-2009-03-04.orig/drivers/xen/pciback/conf_space_quirks.c 2008-09-01 12:20:11.000000000 +0200
17 +++ sle11-2009-03-04/drivers/xen/pciback/conf_space_quirks.c 2009-03-04 11:25:24.000000000 +0100
18 @@ -13,13 +13,25 @@
19
20 LIST_HEAD(pciback_quirks);
21
22 +static inline const struct pci_device_id *
23 +match_one_device(const struct pci_device_id *id, const struct pci_dev *dev)
24 +{
25 + if ((id->vendor == PCI_ANY_ID || id->vendor == dev->vendor) &&
26 + (id->device == PCI_ANY_ID || id->device == dev->device) &&
27 + (id->subvendor == PCI_ANY_ID || id->subvendor == dev->subsystem_vendor) &&
28 + (id->subdevice == PCI_ANY_ID || id->subdevice == dev->subsystem_device) &&
29 + !((id->class ^ dev->class) & id->class_mask))
30 + return id;
31 + return NULL;
32 +}
33 +
34 struct pciback_config_quirk *pciback_find_quirk(struct pci_dev *dev)
35 {
36 struct pciback_config_quirk *tmp_quirk;
37
38 list_for_each_entry(tmp_quirk, &pciback_quirks, quirks_list)
39 - if (pci_match_id(&tmp_quirk->devid, dev))
40 - goto out;
41 + if (match_one_device(&tmp_quirk->devid, dev) != NULL)
42 + goto out;
43 tmp_quirk = NULL;
44 printk(KERN_DEBUG
45 "quirk didn't match any device pciback knows about\n");