summaryrefslogtreecommitdiffstats
path: root/src/soc/nvidia/tegra124
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/soc/nvidia/tegra124
parentcb08c7937dd21bcc1b6847104beab77fb787ff07 (diff)
downloadcoreboot-7c60068b2345a79ab5c12f1484c50fca6006d59f.tar.gz
coreboot-7c60068b2345a79ab5c12f1484c50fca6006d59f.tar.bz2
coreboot-7c60068b2345a79ab5c12f1484c50fca6006d59f.zip
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/soc/nvidia/tegra124')
-rw-r--r--src/soc/nvidia/tegra124/soc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/soc/nvidia/tegra124/soc.c b/src/soc/nvidia/tegra124/soc.c
index 95f62a354561..64fb8681ce64 100644
--- a/src/soc/nvidia/tegra124/soc.c
+++ b/src/soc/nvidia/tegra124/soc.c
@@ -16,13 +16,13 @@
*/
static void soc_read_resources(struct device *dev)
{
- u32 lcdbase = fb_base_mb();
- unsigned long fb_size = FB_SIZE_MB;
+ uint64_t lcdbase = fb_base_mb();
+ uint64_t fb_size = FB_SIZE_MB;
ram_from_to(dev, 0, (uintptr_t)_dram, (sdram_max_addressable_mb() - fb_size) * MiB);
mmio_range(dev, 1, lcdbase * MiB, fb_size * MiB);
- ram_from_to(dev, 2, sdram_max_addressable_mb() * MiB,
+ ram_from_to(dev, 2, sdram_max_addressable_mb() * (uint64_t)MiB,
(uintptr_t)_dram + sdram_size_mb() * (uint64_t)MiB);
}