diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-09-28 22:01:40 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-22 17:57:43 +0200 |
commit | 72675479925f53af051ae8a78bcfafeaa47b3eef (patch) | |
tree | 565aa9eda9af359c7a3fcef4c6dd11d532d38b8e | |
parent | EHCI: use the isochronous scheduling threshold (diff) | |
download | linux-72675479925f53af051ae8a78bcfafeaa47b3eef.tar.xz linux-72675479925f53af051ae8a78bcfafeaa47b3eef.zip |
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 <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index b764cab2ab9a..e08e65d8e004 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; } |