Ok, thats not much, but it dosn't harm either.
Erm,  at least as long as UHCI_NUMFRAMES is a power of 2
;-)

Karsten


        

        
                
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: 
http://mail.yahoo.de
--- drivers/usb/host/uhci-hcd.c0	2004-10-15 04:15:47.000000000 +0200
+++ drivers/usb/host/uhci-hcd.c	2004-10-15 04:16:42.000000000 +0200
@@ -64,7 +64,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v2.2"
+#define DRIVER_VERSION "v2.3"
 #define DRIVER_AUTHOR "Linus 'Frodo Rabbit' Torvalds, Johannes Erdfelt, \
 Randy Dunlap, Georg Acher, Deti Fliegl, Thomas Sailer, Roman Weissgaerber, \
 Alan Stern"
@@ -174,7 +174,7 @@
  */
 static void uhci_insert_td_frame_list(struct uhci_hcd *uhci, struct uhci_td *td, unsigned framenum)
 {
-	framenum %= UHCI_NUMFRAMES;
+	framenum &= (UHCI_NUMFRAMES - 1);
 
 	td->frame = framenum;
 
@@ -1144,12 +1144,12 @@
 		if (limits) {
 			int curframe;
 
-			curframe = uhci_get_current_frame_number(uhci) % UHCI_NUMFRAMES;
-			urb->start_frame = (curframe + 10) % UHCI_NUMFRAMES;
+			curframe = uhci_get_current_frame_number(uhci);
+			urb->start_frame = (curframe + 10) & (UHCI_NUMFRAMES - 1);
 		} else
 			urb->start_frame = end;
 	} else {
-		urb->start_frame %= UHCI_NUMFRAMES;
+		urb->start_frame &= (UHCI_NUMFRAMES - 1);
 		/* FIXME: Sanity check */
 	}
 

Reply via email to