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

From: Ido Yariv
Date: Fri May 11 2012 - 15:26:37 EST


Hi,

On Wed, May 09, 2012 at 08:55:54AM -0700, H. Peter Anvin wrote:
> On 05/09/2012 08:44 AM, Ingo Molnar wrote:
> >
> > * 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.
> >
>
> What on Earth is the point of allowing that combination? Why not make
> X86_VSMP depend on SMP and reduce the testing matrix?

CONFIG_X86_VSMP shouldn't be used without CONFIG_SMP, so we can safely
add this dependency.
Ingo's suggestion will still fix unreferenced variables warnings, so how
about the following patch?

Thanks,
Ido.