Commit 7eb90579 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] Fix rounded-up integer division bug

PCM Midlevel
    This patch is against alsa-driver-1.0.8.
    It covers:
        alsa-kernel/core/pcm_lib.c

    It corresponds to bug description:
        <https://bugtrack.alsa-project.org/alsa-bug/view.php?id=951>

    The patch fixes the following problem:

     -- Properly perform rounded-up integer division in
        snd_pcm_system_tick_set() in pcm_lib.c.

        This only had a minor impact.
Signed-off-by: default avatarCharles Levert <charles_levert@gna.org>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent e5840422
......@@ -1863,9 +1863,8 @@ static void snd_pcm_system_tick_set(snd_pcm_substream_t *substream,
if (ticks == 0)
del_timer(&runtime->tick_timer);
else {
ticks += (1000000 / HZ) - 1;
ticks /= (1000000 / HZ);
if (ticks % (1000000 / HZ))
ticks++;
mod_timer(&runtime->tick_timer, jiffies + ticks);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment