Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit eafe8404 authored by Tina Ruchandani's avatar Tina Ruchandani Committed by Takashi Iwai
Browse files

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: default avatarTina Ruchandani <ruchandani.tina@gmail.com>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent df57de17
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment