From: Nishanth Aravamudan <nacc@us.ibm.com>
To: eokerson@quicknet.net
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: [-mm PATCH 31/32] telephony: fix-up schedule_timeout() usage
Date: Mon, 15 Aug 2005 11:29:44 -0700 [thread overview]
Message-ID: <20050815182944.GH2854@us.ibm.com> (raw)
In-Reply-To: <20050815180514.GC2854@us.ibm.com>
Description: Use schedule_timeout_uninterruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
---
drivers/telephony/ixj.c | 54 ++++++++++++++++--------------------------------
1 files changed, 18 insertions(+), 36 deletions(-)
diff -urpN 2.6.13-rc5-mm1/drivers/telephony/ixj.c 2.6.13-rc5-mm1-dev/drivers/telephony/ixj.c
--- 2.6.13-rc5-mm1/drivers/telephony/ixj.c 2005-08-07 10:05:21.000000000 -0700
+++ 2.6.13-rc5-mm1-dev/drivers/telephony/ixj.c 2005-08-10 14:29:41.000000000 -0700
@@ -2071,8 +2071,7 @@ static int ixj_ring(IXJ *j)
j->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 *)&j->busyflags) != 0) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
+ while(test_and_set_bit(board, (void *)&j->busyflags) != 0)
+ schedule_timeout_interruptible(1);
if (ixjdebug & 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->board, &j->busyflags);
- while(j->tone_state) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
- while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
+ while(j->tone_state)
+ schedule_timeout_interruptible(1);
+ while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0)
+ schedule_timeout_interruptible(1);
if(ixjdebug & 0x0200) {
printk("IXJ cidcw phone%d first tone end at %ld\n", j->board, jiffies);
}
@@ -3313,14 +3305,10 @@ static void ixj_write_cidcw(IXJ *j)
ixj_play_tone(j, 24);
clear_bit(j->board, &j->busyflags);
- while(j->tone_state) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
- while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
+ while(j->tone_state)
+ schedule_timeout_interruptible(1);
+ while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0)
+ schedule_timeout_interruptible(1);
if(ixjdebug & 0x0200) {
printk("IXJ cidcw phone%d sent second tone at %ld\n", j->board, jiffies);
}
@@ -3328,14 +3316,10 @@ static void ixj_write_cidcw(IXJ *j)
j->cidcw_wait = jiffies + ((50 * hertz) / 100);
clear_bit(j->board, &j->busyflags);
- while(!j->flags.cidcw_ack && time_before(jiffies, j->cidcw_wait)) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
- while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
+ while(!j->flags.cidcw_ack && time_before(jiffies, j->cidcw_wait))
+ schedule_timeout_interruptible(1);
+ while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0)
+ schedule_timeout_interruptible(1);
j->cidcw_wait = 0;
if(!j->flags.cidcw_ack) {
if(ixjdebug & 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 *)&j->busyflags) != 0) {
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
+ while(test_and_set_bit(board, (void *)&j->busyflags) != 0)
+ schedule_timeout_interruptible(1);
if (ixjdebug & 0x0040)
printk("phone%d ioctl, cmd: 0x%x, arg: 0x%lx\n", minor, cmd, arg);
if (minor >= IXJMAX) {
prev parent reply other threads:[~2005-08-15 18:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-15 18:05 [-mm PATCH 0/32] fix-up schedule_timeout() usage Nishanth Aravamudan
2005-08-15 18:06 ` [-mm PATCH 1/32] include: update jiffies/{m,u}secs conversion functions Nishanth Aravamudan
2005-08-17 23:35 ` Andrew Morton
2005-08-18 3:19 ` Nishanth Aravamudan
2005-08-15 18:08 ` [-mm PATCH 2/32] fs: fix-up schedule_timeout() usage Nishanth Aravamudan
2005-08-15 18:17 ` [xfs-masters] " Christoph Hellwig
2005-08-15 18:40 ` Nishanth Aravamudan
2005-08-15 20:36 ` Christoph Hellwig
2005-08-15 18:37 ` Stephen C. Tweedie
2005-08-15 18:08 ` [-mm PATCH 3/32] kernel: " Nishanth Aravamudan
2005-08-15 18:09 ` [-mm PATCH 4/32] mm: " Nishanth Aravamudan
2005-08-15 18:18 ` [-mm PATCH 17/32] drivers/cdrom: " Nishanth Aravamudan
2005-08-15 18:19 ` [-mm PATCH 19/32] drivers/dlm: " Nishanth Aravamudan
2005-08-15 18:25 ` [-mm PATCH 26/32] message: " Nishanth Aravamudan
2005-08-15 18:26 ` [-mm PATCH 28/32] drivers/sbus: " Nishanth Aravamudan
2005-08-15 18:29 ` Nishanth Aravamudan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050815182944.GH2854@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=akpm@osdl.org \
--cc=eokerson@quicknet.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox