Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] telephony: fix-up schedule_timeout() usage

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

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Nishanth Aravamudan and committed by
Linus Torvalds
1e63bc73 7b4ccf8d

+18 -36
+18 -36
drivers/telephony/ixj.c
··· 2071 2071 j->flags.ringing = 0; 2072 2072 return 1; 2073 2073 } 2074 - set_current_state(TASK_INTERRUPTIBLE); 2075 - schedule_timeout(1); 2074 + schedule_timeout_interruptible(1); 2076 2075 if (signal_pending(current)) 2077 2076 break; 2078 2077 } ··· 2085 2086 return 1; 2086 2087 } 2087 2088 } 2088 - set_current_state(TASK_INTERRUPTIBLE); 2089 - schedule_timeout(1); 2089 + schedule_timeout_interruptible(1); 2090 2090 if (signal_pending(current)) 2091 2091 break; 2092 2092 } ··· 2151 2153 * Set up locks to ensure that only one process is talking to the DSP at a time. 2152 2154 * This is necessary to keep the DSP from locking up. 2153 2155 */ 2154 - while(test_and_set_bit(board, (void *)&j->busyflags) != 0) { 2155 - set_current_state(TASK_INTERRUPTIBLE); 2156 - schedule_timeout(1); 2157 - } 2156 + while(test_and_set_bit(board, (void *)&j->busyflags) != 0) 2157 + schedule_timeout_interruptible(1); 2158 2158 if (ixjdebug & 0x0002) 2159 2159 printk(KERN_INFO "Closing board %d\n", NUM(inode)); 2160 2160 ··· 3282 3286 ixj_play_tone(j, 23); 3283 3287 3284 3288 clear_bit(j->board, &j->busyflags); 3285 - while(j->tone_state) { 3286 - set_current_state(TASK_INTERRUPTIBLE); 3287 - schedule_timeout(1); 3288 - } 3289 - while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) { 3290 - set_current_state(TASK_INTERRUPTIBLE); 3291 - schedule_timeout(1); 3292 - } 3289 + while(j->tone_state) 3290 + schedule_timeout_interruptible(1); 3291 + while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) 3292 + schedule_timeout_interruptible(1); 3293 3293 if(ixjdebug & 0x0200) { 3294 3294 printk("IXJ cidcw phone%d first tone end at %ld\n", j->board, jiffies); 3295 3295 } ··· 3305 3313 ixj_play_tone(j, 24); 3306 3314 3307 3315 clear_bit(j->board, &j->busyflags); 3308 - while(j->tone_state) { 3309 - set_current_state(TASK_INTERRUPTIBLE); 3310 - schedule_timeout(1); 3311 - } 3312 - while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) { 3313 - set_current_state(TASK_INTERRUPTIBLE); 3314 - schedule_timeout(1); 3315 - } 3316 + while(j->tone_state) 3317 + schedule_timeout_interruptible(1); 3318 + while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) 3319 + schedule_timeout_interruptible(1); 3316 3320 if(ixjdebug & 0x0200) { 3317 3321 printk("IXJ cidcw phone%d sent second tone at %ld\n", j->board, jiffies); 3318 3322 } ··· 3316 3328 j->cidcw_wait = jiffies + ((50 * hertz) / 100); 3317 3329 3318 3330 clear_bit(j->board, &j->busyflags); 3319 - while(!j->flags.cidcw_ack && time_before(jiffies, j->cidcw_wait)) { 3320 - set_current_state(TASK_INTERRUPTIBLE); 3321 - schedule_timeout(1); 3322 - } 3323 - while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) { 3324 - set_current_state(TASK_INTERRUPTIBLE); 3325 - schedule_timeout(1); 3326 - } 3331 + while(!j->flags.cidcw_ack && time_before(jiffies, j->cidcw_wait)) 3332 + schedule_timeout_interruptible(1); 3333 + while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) 3334 + schedule_timeout_interruptible(1); 3327 3335 j->cidcw_wait = 0; 3328 3336 if(!j->flags.cidcw_ack) { 3329 3337 if(ixjdebug & 0x0200) { ··· 6094 6110 * Set up locks to ensure that only one process is talking to the DSP at a time. 6095 6111 * This is necessary to keep the DSP from locking up. 6096 6112 */ 6097 - while(test_and_set_bit(board, (void *)&j->busyflags) != 0) { 6098 - set_current_state(TASK_INTERRUPTIBLE); 6099 - schedule_timeout(1); 6100 - } 6113 + while(test_and_set_bit(board, (void *)&j->busyflags) != 0) 6114 + schedule_timeout_interruptible(1); 6101 6115 if (ixjdebug & 0x0040) 6102 6116 printk("phone%d ioctl, cmd: 0x%x, arg: 0x%lx\n", minor, cmd, arg); 6103 6117 if (minor >= IXJMAX) {