Re: [PATCH v4] vsmp: Fix number of CPUs when vsmp is disabled

From: Ingo Molnar
Date: Wed May 09 2012 - 11:45:18 EST



* Ido Yariv <ido@xxxxxxxxxx> wrote:

> +static void __init vsmp_cap_cpus(void)
> +{
> + void __iomem *address;
> + unsigned int cfg, topology, node_shift, maxcpus;
> +
> +#ifdef CONFIG_X86_VSMP
> + /* VSMP is enabled, no need to cap cpus */
> + return;
> +#elif defined(CONFIG_SMP)
> + /*
> + * CONFIG_X86_VSMP is not configured, so limit the number CPUs to the

I suspect this will throw compiler warnings in the
CONFIG_X86_VSMP && !CONFIG_SMP case.

Why not do something like:

static void __init vsmp_cap_cpus(void)
{
#if !defined(CONFIG_X86_VSMP) && defined(CONFIG_SMP)
...
#endif
}

This keeps the #ifdef complexity reasonably concentrated.

Thanks,

Ingo
--
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/