From: Alan Stern Date: Fri, 28 Sep 2012 20:01:40 +0000 (-0400) Subject: EHCI: replace mult/div with bit-mask operation X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=72675479925f53af051ae8a78bcfafeaa47b3eef;p=linux.git EHCI: replace mult/div with bit-mask operation This patch (as1610) replaces multiplication and divison operations in ehci-hcd's isochronous scheduling code with a bit-mask operation, taking advantage of the fact that isochronous periods are always powers of 2. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index b764cab2ab9ac..e08e65d8e0047 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c @@ -1416,7 +1416,7 @@ iso_stream_schedule ( /* Behind the scheduling threshold? Assume URB_ISO_ASAP. */ if (unlikely(start < next)) - start += period * DIV_ROUND_UP(next - start, period); + start += (next - start + period - 1) & (- period); start += base; }