diff options
author | Greg Kurz | 2019-11-25 07:58:03 +0100 |
---|---|---|
committer | David Gibson | 2019-12-17 00:39:47 +0100 |
commit | 4fa28f23906dc268c4c3be3236f15a4de1093c18 (patch) | |
tree | 9090982bfb2e22b36ad5539914a6f9329b0b13cc /include/hw | |
parent | ppc/xive: Implement the XivePresenter interface (diff) | |
download | qemu-4fa28f23906dc268c4c3be3236f15a4de1093c18.tar.gz qemu-4fa28f23906dc268c4c3be3236f15a4de1093c18.tar.xz qemu-4fa28f23906dc268c4c3be3236f15a4de1093c18.zip |
ppc/pnv: Instantiate cores separately
Allocating a big void * array to store multiple objects isn't a
recommended practice for various reasons:
- no compile time type checking
- potential dangling pointers if a reference on an individual is
taken and the array is freed later on
- duplicate boiler plate everywhere the array is browsed through
Allocate an array of pointers and populate it instead.
Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20191125065820.927-4-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/ppc/pnv.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index 90f1343ed0..03cb429f21 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -56,7 +56,7 @@ typedef struct PnvChip { uint32_t nr_cores; uint64_t cores_mask; - void *cores; + PnvCore **cores; MemoryRegion xscom_mmio; MemoryRegion xscom; |