Skip to contentSkip to conversation

polling loops: change exit condition to

PATCH In review Marcin Slusarz 1 participant 1 message Dec 4, 2005

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

PATCH 3/21 polling loops: change exit condition to

BLOCK LAYER
P: Jens Axboe
M: [email protected]

drivers/block/sx8.c +3 -2
diff -upr -X linux-2.6.15-rc4/Documentation/dontdiff linux-2.6.15-rc4-orig/drivers/block/sx8.c linux-2.6.15-rc4/drivers/block/sx8.c
@@ -570,9 +570,10 @@ static struct carm_request *carm_get_spe
 	unsigned long flags;
 	struct carm_request *crq = NULL;
 	struct request *rq;
-	int tries = 5000;
+	unsigned long end_time;
 
-	while (tries-- > 0) {
+	end_time = jiffies + msecs_to_jiffies(50000);
+	while (time_before(jiffies, end_time)) {
 		spin_lock_irqsave(&host->lock, flags);
 		crq = carm_get_request(host);
 		spin_unlock_irqrestore(&host->lock, flags);

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