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>
This commit is contained in:
Patrick Rudolph 2018-07-11 13:57:41 +02:00 committed by Philipp Deppenwiese
parent f4d81e0385
commit ded0c77d48
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}