summaryrefslogtreecommitdiff
path: root/src/mainboard/emulation/qemu-i440fx
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2022-07-01 18:50:26 +0300
committerFelix Held <felix-coreboot@felixheld.de>2022-07-04 14:11:06 +0000
commit7c60068b2345a79ab5c12f1484c50fca6006d59f (patch)
treed826d8e24800aec1d32fb04af262190cc31c9472 /src/mainboard/emulation/qemu-i440fx
parentcb08c7937dd21bcc1b6847104beab77fb787ff07 (diff)
mb/qemu-i440fx,soc/nvidia: Fix coverity reported defects
In reality the expression should not overflow as the value fits in 32 bits. Change-Id: I50d83dce25a4d464e1c979502c290d8ecd733018 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65613 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/mainboard/emulation/qemu-i440fx')
-rw-r--r--src/mainboard/emulation/qemu-i440fx/northbridge.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/northbridge.c b/src/mainboard/emulation/qemu-i440fx/northbridge.c
index 96a234e580..07f345af4d 100644
--- a/src/mainboard/emulation/qemu-i440fx/northbridge.c
+++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c
@@ -47,7 +47,7 @@ static void cpu_pci_domain_read_resources(struct device *dev)
int i440fx = (nbid == 0x1237);
int q35 = (nbid == 0x29c0);
struct resource *res;
- unsigned long tomk = 0;
+ uint64_t tomk = 0;
int idx = 10;
FWCfgFile f;
@@ -93,7 +93,7 @@ static void cpu_pci_domain_read_resources(struct device *dev)
/* qemu older than 1.7, or reading etc/e820 failed. Fallback to cmos. */
tomk = qemu_get_memory_size();
uint64_t high = qemu_get_high_memory_size();
- printk(BIOS_DEBUG, "QEMU: cmos: %lu MiB RAM below 4G.\n", tomk / 1024);
+ printk(BIOS_DEBUG, "QEMU: cmos: %llu MiB RAM below 4G.\n", tomk / 1024);
printk(BIOS_DEBUG, "QEMU: cmos: %llu MiB RAM above 4G.\n", high / 1024);
/* Report the memory regions. */