bt: remove muldiv64()
commitfdfea124f9e12232f99d9f235267ca1eeeb23469
authorLaurent Vivier <lvivier@redhat.com>
Tue, 25 Aug 2015 15:19:57 +0000 (25 17:19 +0200)
committerLaurent Vivier <lvivier@redhat.com>
Fri, 25 Sep 2015 12:56:22 +0000 (25 14:56 +0200)
treedd679eb3cdb3bef9e1687c640555c00508bb20c8
parent0a4f9240f5b8b1bfe2d5c5c2748545bc23771bb4
bt: remove muldiv64()

Originally, timers were ticks based, and it made sense to
add ticks to current time to know when to trigger an alarm.

But since commit:

7447545 change all other clock references to use nanosecond resolution accessors

All timers use nanoseconds and we need to convert ticks to nanoseconds.

As get_ticks_per_sec() is 10^9,

    a = muldiv64(b, get_ticks_per_sec(), 100);
    y = muldiv64(x, get_ticks_per_sec(), 1000000);

can be converted to

    a = b * 10000000;
    y = x * 1000;

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
hw/bt/hci.c