[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/arm/virt: Remove virt machine state 'smp_cpus'
From: |
Andrew Jones |
Subject: |
Re: [PATCH] hw/arm/virt: Remove virt machine state 'smp_cpus' |
Date: |
Wed, 16 Dec 2020 07:43:53 +0100 |
On Tue, Dec 15, 2020 at 06:20:48PM +0000, David Edmondson wrote:
> On Tuesday, 2020-12-15 at 18:48:15 +01, Andrew Jones wrote:
>
> > virt machine's 'smp_cpus' and machine->smp.cpus must always have the
> > same value. And, anywhere we have virt machine state we have machine
> > state. So let's remove the redundancy. Also, to make it easier to see
> > that machine->smp is the true source for "smp_cpus" and "max_cpus",
> > avoid passing them in function parameters, preferring instead to get
> > them from the state.
> >
> > No functional change intended.
> >
> > Signed-off-by: Andrew Jones <drjones@redhat.com>
>
> Minor question below...
>
> Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Thanks
> > static void fdt_add_cpu_nodes(const VirtMachineState *vms)
> > {
> > - int cpu;
> > - int addr_cells = 1;
> > const MachineState *ms = MACHINE(vms);
> > + int smp_cpus = ms->smp.cpus, cpu;
>
> Is it house-style to have initialised and un-initialised local variables
> declared on the same line?
>
checkpatch.pl doesn't complain and a grep of qemu shows hundreds of other
examples. That said, I only see one other example in hw/arm/virt.c, so if
we'd rather avoid it, I'll repost.
Thanks,
drew