[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:
>>>> 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

> 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.

> 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) && 
It is ugly, especially if there are more macros.

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?

Yu Zhiguo

Xen-devel mailing list



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