[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] pv-ops: Fix missing 'ifdef CONFIG_XEN' in acpi



Konrad Rzeszutek Wilk wrote:
>> method-3)
>>> Or maybe better take out the xen_register_gsi out of this double
>>> #ifdef and move it to its own. Say:
>>>
>>>
>>> #if !defined(CONFIG_XEN)
>>> static int xen_register_gsi(..)
>>>
>>> #endif
>> We must use #if !defined(CONFIG_XEN) || (defined(CONFIG_XEN) && 
>> !defined(CONFIG_XEN_DOM0_PCI)).
>> It is ugly, especially if there are more macros.
> 
> Lets go with this one. Maybe after this is done there will be a way to
> unmangle this spaghetti mess.
> 
> 
> 

OK, please refer to this new version:

----------------

routines 'xen_register_gsi' and 'xen_setup_msi_irqs' cannot be used
unless macro 'CONFIG_XEN' is defined, otherwise build error occurs.
So fix them in the header file.

Signed-off-by: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>
---
 arch/x86/include/asm/xen/pci.h |   55 +++++++++++++++++++++------------------
 1 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/arch/x86/include/asm/xen/pci.h b/arch/x86/include/asm/xen/pci.h
index 650645d..27e0667 100644
--- a/arch/x86/include/asm/xen/pci.h
+++ b/arch/x86/include/asm/xen/pci.h
@@ -14,36 +14,12 @@ void xen_teardown_msi_dev(struct pci_dev *dev);
 int xen_find_device_domain_owner(struct pci_dev *dev);
 int xen_register_device_domain_owner(struct pci_dev *dev, uint16_t domain);
 int xen_unregister_device_domain_owner(struct pci_dev *dev);
-
-#else
-static inline int xen_register_gsi(u32 gsi, int triggering, int polarity)
-{
-       return -1;
-}
-static inline int xen_find_device_domain_owner(struct pci_dev *dev)
-{
-       return -1;
-}
-static inline int xen_register_device_domain_owner(struct pci_dev *dev,
-                                                  uint16_t domain)
-{
-       return -1;
-}
-static inline int xen_unregister_device_domain_owner(struct pci_dev *dev)
-{
-       return -1;
-}
-static inline void xen_teardown_msi_dev(struct pci_dev *dev) { }
 #endif
 
 #if defined(CONFIG_PCI_MSI) && defined(CONFIG_XEN_DOM0_PCI)
 int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
-#else
-static inline int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
-{
-       return -1;
-}
 #endif
+
 #if defined(CONFIG_PCI_MSI)
 
 /* The drivers/pci/xen-pcifront.c sets this structure to
@@ -97,4 +73,33 @@ static inline int xen_create_msi_irq(struct pci_dev *dev,
        return -1;
 }
 #endif
+
+#if !defined(CONFIG_XEN) || (defined(CONFIG_XEN) && 
!defined(CONFIG_XEN_DOM0_PCI))
+static inline int xen_register_gsi(u32 gsi, int triggering, int polarity)
+{
+       return -1;
+}
+static inline int xen_find_device_domain_owner(struct pci_dev *dev)
+{
+       return -1;
+}
+static inline int xen_register_device_domain_owner(struct pci_dev *dev,
+                                                  uint16_t domain)
+{
+       return -1;
+}
+static inline int xen_unregister_device_domain_owner(struct pci_dev *dev)
+{
+       return -1;
+}
+static inline void xen_teardown_msi_dev(struct pci_dev *dev) { }
+#endif
+
+#if !defined(CONFIG_XEN) || (defined(CONFIG_XEN) && \
+       (!defined(CONFIG_PCI_MSI) || !defined(CONFIG_XEN_DOM0_PCI)))
+static inline int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+{
+       return -1;
+}
+#endif
 #endif /* _ASM_X86_XEN_PCI_H */
-- 
1.5.4.2



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.