From: Clemens Ladisch Date: Mon, 17 Jul 2006 14:50:56 +0000 (+0200) Subject: [ALSA] system timer: fix lost ticks correction adjustment X-Git-Tag: v2.6.19-rc1~1270^2~132 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=17f48ec3f15ddb8080b151304ee887c68f7e4650;p=linux-2.6-omap-h63xx.git [ALSA] system timer: fix lost ticks correction adjustment Fix the adjustment of the lost ticks correction variable in the case when the correction has been fully taken into account in the next timer expiration value. Subtracting the scheduled ticks value would result in an underflow. Signed-off-by: Clemens Ladisch Signed-off-by: Jaroslav Kysela --- diff --git a/sound/core/timer.c b/sound/core/timer.c index 7e5e562fe35..86357007259 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -987,7 +987,7 @@ static int snd_timer_s_start(struct snd_timer * timer) njiff++; } else { njiff += timer->sticks - priv->correction; - priv->correction -= timer->sticks; + priv->correction = 0; } priv->last_expires = priv->tlist.expires = njiff; add_timer(&priv->tlist);