Skip to contentSkip to conversation

parport/ieee1284: use human-time in sleeping logic

PATCH New Nishanth Aravamudan 1 participant 1 message May 2, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parport/ieee1284: use human-time in sleeping logic

Be a little more precise with the conversions between milliseconds and jiffies. Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected.

drivers/parport/ieee1284.c +3 -5
@@ -196,7 +196,7 @@ int parport_wait_peripheral(struct parpo
 		return 1;
 
 	/* 40ms of slow polling. */
-	deadline = jiffies + (HZ + 24) / 25;
+	deadline = jiffies + msecs_to_jiffies(40);
 	while (time_before (jiffies, deadline)) {
 		int ret;
 
@@ -212,13 +212,11 @@ int parport_wait_peripheral(struct parpo
 		if ((status & mask) == result)
 			return 0;
 
-		if (!ret) {
+		if (!ret)
 			/* parport_wait_event didn't time out, but the
 			 * peripheral wasn't actually ready either.
 			 * Wait for another 10ms. */
-			__set_current_state (TASK_INTERRUPTIBLE);
-			schedule_timeout ((HZ+ 99) / 100);
-		}
+			msleep_interruptible(10);
 	}
 
 	return 1;

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors