diff options
author | Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> | 2014-10-28 13:27:44 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-28 15:07:25 +0100 |
commit | 326f0480b7f8504c4f594c4f36ab7874e17780bc (patch) | |
tree | 1b44805bde641b1141c64a61cfc89d3f917c6bde /sound/pci/pcxhr/pcxhr.c | |
parent | ALSA: hda - Pass printf argument directly to request_module() (diff) | |
download | linux-326f0480b7f8504c4f594c4f36ab7874e17780bc.tar.xz linux-326f0480b7f8504c4f594c4f36ab7874e17780bc.zip |
ALSA: pcxhr: convert timeval to ktime_t
This patch is concerned with migrating the time variables in the pcxhr
module found in the sound driver. The changes are concerend with the
y2038 problem where timeval will overflow in the year 2038. ktime_t
was used instead of timeval to get the wall time. The difference
is displayed now in nanoseconds instead of microseconds.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/pcxhr/pcxhr.c')
-rw-r--r-- | sound/pci/pcxhr/pcxhr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index b854fc5e01f5..7c33c973dbd5 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -711,8 +711,9 @@ static void pcxhr_start_linked_stream(struct pcxhr_mgr *mgr) int playback_mask = 0; #ifdef CONFIG_SND_DEBUG_VERBOSE - struct timeval my_tv1, my_tv2; - do_gettimeofday(&my_tv1); + ktime_t start_time, stop_time, diff_time; + + start_time = ktime_get(); #endif mutex_lock(&mgr->setup_mutex); @@ -823,9 +824,10 @@ static void pcxhr_start_linked_stream(struct pcxhr_mgr *mgr) mutex_unlock(&mgr->setup_mutex); #ifdef CONFIG_SND_DEBUG_VERBOSE - do_gettimeofday(&my_tv2); + stop_time = ktime_get(); + diff_time = ktime_sub(stop_time, start_time); dev_dbg(&mgr->pci->dev, "***TRIGGER START*** TIME = %ld (err = %x)\n", - (long)(my_tv2.tv_usec - my_tv1.tv_usec), err); + (long)(ktime_to_ns(diff_time)), err); #endif } |