]> xenbits.xensource.com Git - seabios.git/commit
timer: Avoid integer overflows in usec and nsec calculations
authorKevin O'Connor <kevin@koconnor.net>
Thu, 2 Nov 2017 15:21:14 +0000 (11:21 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 2 Nov 2017 15:28:25 +0000 (11:28 -0400)
commit488e1c3fef2e789d38a5190baae977131a911fa7
tree46846492609a01d9b86f3dddcf478e808c2e1ea4
parentcd47172a673762a05a0c7bd27df6e3cc8febe8d6
timer: Avoid integer overflows in usec and nsec calculations

When timer_calc_usec() is used with large timeout values, such as 60s,
the integer math can overflow and produce different results than when
using timer_calc(time / 1000) for the same timeout.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/hw/timer.c