All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Yu Zhiguo <yuzg@cn.fujitsu.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH] pv-ops: Fix missing 'ifdef CONFIG_XEN' in acpi
Date: Wed, 21 Apr 2010 09:33:02 -0700	[thread overview]
Message-ID: <4BCF28BE.4000206@goop.org> (raw)
In-Reply-To: <4BCF0352.50909@cn.fujitsu.com>

On 04/21/2010 06:53 AM, Yu Zhiguo wrote:
> 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@cn.fujitsu.com>
> ---
>  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))
>   

As I mentioned in the other mail, there's no need to test CONFIG_XEN.

> +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)))
>   

Likewise.

    J

  reply	other threads:[~2010-04-21 16:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-16  2:07 [PATCH] pv-ops: Fix missing 'ifdef CONFIG_XEN' in acpi Yu Zhiguo
2010-04-16 14:56 ` Konrad Rzeszutek Wilk
2010-04-18  3:56   ` Yu Zhiguo
2010-04-18  4:46     ` Jeremy Fitzhardinge
2010-04-19 13:30       ` Konrad Rzeszutek Wilk
2010-04-19 16:22         ` Jeremy Fitzhardinge
2010-04-20  5:31         ` Yu Zhiguo
2010-04-20 18:33           ` Konrad Rzeszutek Wilk
2010-04-21  3:29             ` Yu Zhiguo
2010-04-21 13:00               ` Konrad Rzeszutek Wilk
2010-04-21 13:53                 ` Yu Zhiguo
2010-04-21 16:33                   ` Jeremy Fitzhardinge [this message]
2010-04-22  4:05                     ` Yu Zhiguo
2010-04-22 16:27                       ` Jeremy Fitzhardinge
2010-04-25  4:24                         ` Yu Zhiguo
2010-04-21 16:31               ` Jeremy Fitzhardinge
2010-04-19 11:23   ` Failure to load the most recent kernel 2.6.10 ( xen/stable) under Xen 4.0 on Ubuntu 9.10 Boris Derzhavets
2010-04-20 10:44     ` Failure to load the most recent kernel 2.6.32.10 " Boris Derzhavets
2010-04-20 12:46       ` Boris Derzhavets
2010-04-20 18:21       ` Jeremy Fitzhardinge
2010-04-20 21:25         ` Boris Derzhavets
2010-04-21  8:05           ` Yu, Ke
2010-04-21 12:19             ` Boris Derzhavets

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=4BCF28BE.4000206@goop.org \
    --to=jeremy@goop.org \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yuzg@cn.fujitsu.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.