hw/riscv/virt.c: calculate socket count once in create_fdt_imsic()
authorDaniel Henrique Barboza <dbarboza@ventanamicro.com>
Tue, 24 Jan 2023 21:22:32 +0000 (18:22 -0300)
committerAlistair Francis <alistair.francis@wdc.com>
Mon, 6 Feb 2023 22:19:23 +0000 (08:19 +1000)
commit2967f37d448b86cc5b9a89d83a4e0f4ec01856be
tree2cc166d8b69a4675c68c878e5b7ba060a7c76934
parentf008a2d218d17b9be998be0045a7a3c229a3376d
hw/riscv/virt.c: calculate socket count once in create_fdt_imsic()

riscv_socket_count() returns either ms->numa_state->num_nodes or 1
depending on NUMA support. In any case the value can be retrieved only
once and used in the rest of the function.

This will also alleviate the rename we're going to do next by reducing
the instances of MachineState 'mc' inside hw/riscv/virt.c.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-Id: <20230124212234.412630-2-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/riscv/virt.c