mtd/include/linux/mtd cfi.h,1.30,1.31

David Woodhouse dwmw2 at infradead.org
Wed Aug 7 06:38:32 EDT 2002


Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv28977

Modified Files:
	cfi.h 
Log Message:
Don't waste a jiffie if need_resched is set -- just yield without timeout.

Index: cfi.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/cfi.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- cfi.h	21 Feb 2002 08:27:43 -0000	1.30
+++ cfi.h	7 Aug 2002 10:38:29 -0000	1.31
@@ -450,17 +450,17 @@
 static inline void cfi_udelay(int us)
 {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
-	if (current->need_resched) {
-		unsigned long t = us * HZ / 1000000;
-		if (t < 1)
-			t = 1;
+	unsigned long t = us * HZ / 1000000;
+	if (t) {
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(t);
+		return;
 	}
-	else
 #endif
-		udelay(us);
+	udelay(us);
+	cond_resched();
 }
+
 static inline void cfi_spin_lock(spinlock_t *mutex)
 {
 	spin_lock_bh(mutex);





More information about the linux-mtd-cvs mailing list