WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

Konrad Rzeszutek Wilk wrote:
>>>> This is a good way of handling it.
>>> The header file change or the #ifdef in the acpi/boot.c file?
>>  Thanks for your explanation, I agree it is also a good idea.
>> But if jeremy think adding #ifdef is ok, I will not fix this patch.
> 
> Huh? I thought that Jeremy mentioned that the #ifdef in the header file
> is the way to go. I was anticipating a patch from you for this... since
> I figured it isn't just as easy as that but there is probably some edge
> case I hadn't thought of.
> 

But what about #if defined(CONFIG_XEN) && !defined(CONFIG_XEN_DOM0_PCI)?

method-1) fix it in *.c

method-2)
> perhaps add:
> 
> #else /* This is for CONFIG_XEN */
> 
> static inline int xen_register_gsi(...)
> {
> 
> }
> #endif
> 

Do you mean duplicate codes are ok?
It will be more complex if there are more macros.

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.

method-4)
If we perfer to fix it in header file, another method, we can use weak 
attribute of gcc.

So there are four method to fix this bug now, I think the fix *.c is easiest.
What's your opinion?

-- 
Regards
Yu Zhiguo


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

<Prev in Thread] Current Thread [Next in Thread>