summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2018-07-11 13:57:41 +0200
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2018-07-12 15:22:06 +0000
commitded0c77d4820213a1c0def799e6ae95ba84cc605 (patch)
treeba36053798f6df74a89d972f8a6ea37e45268f9c
parentf4d81e03859f3dfed186b6a4314bb0fb59cf14ac (diff)
Coverity: Fix CID1393976
Cast to u64 to prevent possible integer overflow. Change-Id: I5c7d25278db54523242314cba6c85ac2f7a6c1f3 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/27447 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
-rw-r--r--src/soc/cavium/cn81xx/clock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/soc/cavium/cn81xx/clock.c b/src/soc/cavium/cn81xx/clock.c
index bd6514cd41..02f152f223 100644
--- a/src/soc/cavium/cn81xx/clock.c
+++ b/src/soc/cavium/cn81xx/clock.c
@@ -63,7 +63,7 @@ u64 thunderx_get_io_clock(void)
rst_boot.u = read64((void *)RST_PF_BAR0);
- return rst_boot.s.pnr_mul * PLL_REF_CLK;
+ return ((u64)rst_boot.s.pnr_mul) * PLL_REF_CLK;
}
/**
@@ -75,5 +75,5 @@ u64 thunderx_get_core_clock(void)
rst_boot.u = read64((void *)RST_PF_BAR0);
- return rst_boot.s.c_mul * PLL_REF_CLK;
+ return ((u64)rst_boot.s.c_mul) * PLL_REF_CLK;
}