Skip to content

Commit

Permalink
EHCI: replace mult/div with bit-mask operation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent 98cae42 commit 7267547
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7267547

Please sign in to comment.