Skip to contentSkip to conversation

isdn/boardergo: replace

PATCH New Nishanth Aravamudan 1 participant 1 message Jul 23, 2004 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 isdn/boardergo: replace

I would appreciate any comments from the janitors list. This is one (of many) cases where I made a decision about replacing

set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);

with

msleep(jiffies_to_msecs(some_time));

msleep() is not exactly the same as the previous code, but I only did this replacement where I thought long delays were *desired*. If this is not the case here, then just disregard this patch.

Thanks,
Nish

Applys-to: 2.6.7

Description: Replace schedule_timeout() with msleep() to guarantee the task delays for the desired time.

drivers/isdn/hysdn/boardergo.c +2 -4
@@ -246,8 +246,7 @@ ergo_writebootimg(struct HYSDN_CARD *car
 		/* the interrupts are still masked */
 
 		sti();
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout((20 * HZ) / 1000);	/* Timeout 20ms */
+		msleep(20);
 
 		if (((tDpramBootSpooler *) card->dpram)->Len != DPRAM_SPOOLER_DATA_SIZE) {
 			if (card->debug_flags & LOG_POF_CARD)
@@ -386,8 +385,7 @@ ergo_waitpofready(struct HYSDN_CARD *car
 			return (0);	/* success */
 		}		/* data has arrived */
 		sti();
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout((50 * HZ) / 1000);	/* Timeout 50ms */
+		msleep(50);
 	}			/* wait until timeout */
 
 	if (card->debug_flags & LOG_POF_CARD)

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