ALSA: es1968: Replace timeval with ktime_t
es1968_measure_clock uses struct timeval, which on 32-bit systems will overflow in 2038, leading to incorrect interpretation of time.This patch changes the function to use ktime_t instead of struct timeval, which implies: - no y2038: ktime_t uses a 64-bit datatype explicitly. - efficent subtraction: The earlier version computes the difference in usecs while dealing with secs and nsecs. It requires checks to see if the nsecs of stop is less than start. This patch uses a direct subtract of ktime_t and converts to usecs. - use of monotonic clock (ktime_get) over real time (do_gettimeofday), which simplifies timekeeping, as it does not have to deal with cases where stop_time is less than start_time. Signed-off-by: NTina Ruchandani <ruchandani.tina@gmail.com> Reviewed-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Showing
想要评论请 注册 或 登录