<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Nishanth Aravamudan &lt;nacc@us.ibm.com&gt;

Use schedule_timeout_uninterruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.

(akpm: this patch relies on other stuff in -mm, please don't apply)

Signed-off-by: Nishanth Aravamudan &lt;nacc@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 drivers/telephony/ixj.c |   54 ++++++++++++++++--------------------------------
 1 files changed, 18 insertions(+), 36 deletions(-)

diff -puN drivers/telephony/ixj.c~telephony-fix-up-schedule_timeout-usage drivers/telephony/ixj.c
--- 25/drivers/telephony/ixj.c~telephony-fix-up-schedule_timeout-usage	Wed Aug 17 17:01:13 2005
+++ 25-akpm/drivers/telephony/ixj.c	Wed Aug 17 17:01:13 2005
@@ -2071,8 +2071,7 @@ static int ixj_ring(IXJ *j)
 				j-&gt;flags.ringing = 0;
 				return 1;
 			}
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1);
+			schedule_timeout_interruptible(1);
 			if (signal_pending(current))
 				break;
 		}
@@ -2086,8 +2085,7 @@ static int ixj_ring(IXJ *j)
 					return 1;
 				}
 			}
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1);
+			schedule_timeout_interruptible(1);
 			if (signal_pending(current))
 				break;
 		}
@@ -2153,10 +2151,8 @@ static int ixj_release(struct inode *ino
 	 *    Set up locks to ensure that only one process is talking to the DSP at a time.
 	 *    This is necessary to keep the DSP from locking up.
 	 */
-	while(test_and_set_bit(board, (void *)&amp;j-&gt;busyflags) != 0) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(1);
-	}
+	while(test_and_set_bit(board, (void *)&amp;j-&gt;busyflags) != 0)
+		schedule_timeout_interruptible(1);
 	if (ixjdebug &amp; 0x0002)
 		printk(KERN_INFO "Closing board %d\n", NUM(inode));
 
@@ -3286,14 +3282,10 @@ static void ixj_write_cidcw(IXJ *j)
 	ixj_play_tone(j, 23);
 
 	clear_bit(j-&gt;board, &amp;j-&gt;busyflags);
-	while(j-&gt;tone_state) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(1);
-	}
-	while(test_and_set_bit(j-&gt;board, (void *)&amp;j-&gt;busyflags) != 0) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(1);
-	}
+	while(j-&gt;tone_state)
+		schedule_timeout_interruptible(1);
+	while(test_and_set_bit(j-&gt;board, (void *)&amp;j-&gt;busyflags) != 0)
+		schedule_timeout_interruptible(1);
 	if(ixjdebug &amp; 0x0200) {
 		printk("IXJ cidcw phone%d first tone end at %ld\n", j-&gt;board, jiffies);
 	}
@@ -3313,14 +3305,10 @@ static void ixj_write_cidcw(IXJ *j)
 	ixj_play_tone(j, 24);
 
 	clear_bit(j-&gt;board, &amp;j-&gt;busyflags);
-	while(j-&gt;tone_state) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(1);
-	}
-	while(test_and_set_bit(j-&gt;board, (void *)&amp;j-&gt;busyflags) != 0) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(1);
-	}
+	while(j-&gt;tone_state)
+		schedule_timeout_interruptible(1);
+	while(test_and_set_bit(j-&gt;board, (void *)&amp;j-&gt;busyflags) != 0)
+		schedule_timeout_interruptible(1);
 	if(ixjdebug &amp; 0x0200) {
 		printk("IXJ cidcw phone%d sent second tone at %ld\n", j-&gt;board, jiffies);
 	}
@@ -3328,14 +3316,10 @@ static void ixj_write_cidcw(IXJ *j)
 	j-&gt;cidcw_wait = jiffies + ((50 * hertz) / 100);
 
 	clear_bit(j-&gt;board, &amp;j-&gt;busyflags);
-	while(!j-&gt;flags.cidcw_ack &amp;&amp; time_before(jiffies, j-&gt;cidcw_wait)) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(1);
-	}
-	while(test_and_set_bit(j-&gt;board, (void *)&amp;j-&gt;busyflags) != 0) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(1);
-	}
+	while(!j-&gt;flags.cidcw_ack &amp;&amp; time_before(jiffies, j-&gt;cidcw_wait))
+		schedule_timeout_interruptible(1);
+	while(test_and_set_bit(j-&gt;board, (void *)&amp;j-&gt;busyflags) != 0)
+		schedule_timeout_interruptible(1);
 	j-&gt;cidcw_wait = 0;
 	if(!j-&gt;flags.cidcw_ack) {
 		if(ixjdebug &amp; 0x0200) {
@@ -6110,10 +6094,8 @@ static int ixj_ioctl(struct inode *inode
 	 *    Set up locks to ensure that only one process is talking to the DSP at a time.
 	 *    This is necessary to keep the DSP from locking up.
 	 */
-	while(test_and_set_bit(board, (void *)&amp;j-&gt;busyflags) != 0) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(1);
-	}
+	while(test_and_set_bit(board, (void *)&amp;j-&gt;busyflags) != 0)
+		schedule_timeout_interruptible(1);
 	if (ixjdebug &amp; 0x0040)
 		printk("phone%d ioctl, cmd: 0x%x, arg: 0x%lx\n", minor, cmd, arg);
 	if (minor &gt;= IXJMAX) {
_
</pre></body></html>