Re: [PATCH v2] hwmon (coretemp): Fix build breakage if SMP isundefined

From: Guenter Roeck
Date: Mon Sep 27 2010 - 20:27:40 EST


On Mon, Sep 27, 2010 at 07:44:01PM -0400, Linus Torvalds wrote:
[...]

> include/linux/smp.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/smp.h b/include/linux/smp.h
> index cfa2d20..ad48077 100644
> --- a/include/linux/smp.h
> +++ b/include/linux/smp.h
> @@ -149,6 +149,8 @@ smp_call_function_any(const struct cpumask *mask, void (*func)(void *info),
> return smp_call_function_single(0, func, info, wait);
> }
>
> +static inline const struct cpumask *cpu_sibling_mask(int cpu) { return NULL; }
> +
> #endif /* !SMP */
>
Not that simple. cpu_sibling_mask() is defined in asm/smp.h, which is only
included from linux/smp.h if SMP is defined. But many other files do include
asm/smp.h directly. This causes the following error all over the place
if CONFIG_SMP is not defined.

In file included from /opt/scratch/groeck/linux-staging/arch/x86/include/asm/apic.h:473,
from arch/x86/xen/enlighten.c:46:
/opt/scratch/groeck/linux-staging/arch/x86/include/asm/smp.h:29: error: conflicting types for cpu_sibling_mask
include/linux/smp.h:152: note: previous definition of cpu_sibling_mask was here

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/