diff options
author | BALATON Zoltan <balaton@eik.bme.hu> | 2019-01-03 17:27:24 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2019-02-04 18:44:17 +1100 |
commit | 7d8ccf58d5ee83b140220e34b58ac7d4b5dc6a21 (patch) | |
tree | c35393c7a215774efb1cf61793c0ca210de62c81 /hw/ppc/ppc4xx_devs.c | |
parent | 08fd99179a8c5d34c7065e2ad76c7f8b6afe239e (diff) |
ppc4xx: Use ram_addr_t in ppc4xx_sdram_adjust()
To avoid overflow if larger values are added later use ram_addr_t for
the sdram_bank_sizes parameter to match ram_size to which it is compared.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/ppc4xx_devs.c')
-rw-r--r-- | hw/ppc/ppc4xx_devs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c index 9b6e4c60fa..9418478575 100644 --- a/hw/ppc/ppc4xx_devs.c +++ b/hw/ppc/ppc4xx_devs.c @@ -679,12 +679,12 @@ ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks, MemoryRegion ram_memories[], hwaddr ram_bases[], hwaddr ram_sizes[], - const unsigned int sdram_bank_sizes[]) + const ram_addr_t sdram_bank_sizes[]) { MemoryRegion *ram = g_malloc0(sizeof(*ram)); ram_addr_t size_left = ram_size; ram_addr_t base = 0; - unsigned int bank_size; + ram_addr_t bank_size; int i; int j; |