Skip to content

Commit

Permalink
drivers/char: use __set_current_state()
Browse files Browse the repository at this point in the history
use __set_current_state(TASK_*) instead of current->state = TASK_*,

Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Milind Arun Choudhary authored and Linus Torvalds committed May 8, 2007
1 parent 5ab2f7e commit cc0a8fb
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions drivers/char/amiserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
if (timeout && time_after(jiffies, orig_jiffies + timeout))
break;
}
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies);
#endif
Expand Down Expand Up @@ -1700,7 +1700,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
#endif
schedule();
}
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
remove_wait_queue(&info->open_wait, &wait);
if (extra_count)
state->count++;
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/cyclades.c
Original file line number Diff line number Diff line change
Expand Up @@ -2445,7 +2445,7 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
base_addr = cinfo->base_addr;
firm_id = base_addr + ID_ADDRESS;
if (!ISZLOADED(*cinfo)) {
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
remove_wait_queue(&info->open_wait, &wait);
return -EINVAL;
}
Expand Down Expand Up @@ -2498,7 +2498,7 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
schedule();
}
}
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
remove_wait_queue(&info->open_wait, &wait);
if (!tty_hung_up_p(filp)) {
info->count++;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/epca.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ static int block_til_ready(struct tty_struct *tty,

} /* End forever while */

current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
remove_wait_queue(&ch->open_wait, &wait);
if (!tty_hung_up_p(filp))
ch->count++;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/genrtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static ssize_t gen_rtc_read(struct file *file, char __user *buf,
sizeof(unsigned long);
}
out:
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
remove_wait_queue(&gen_rtc_wait, &wait);

return retval;
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/n_r3964.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,13 +1088,13 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
/* block until there is a message: */
add_wait_queue(&pInfo->read_wait, &wait);
repeat:
current->state = TASK_INTERRUPTIBLE;
__set_current_state(TASK_INTERRUPTIBLE);
pMsg = remove_msg(pInfo, pClient);
if (!pMsg && !signal_pending(current)) {
schedule();
goto repeat;
}
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
remove_wait_queue(&pInfo->read_wait, &wait);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/riscom8.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
}
schedule();
}
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
remove_wait_queue(&port->open_wait, &wait);
if (!tty_hung_up_p(filp))
port->count++;
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/rocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
#endif
schedule(); /* Don't hold spinlock here, will hang PC */
}
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
remove_wait_queue(&info->open_wait, &wait);

spin_lock_irqsave(&info->slock, flags);
Expand Down Expand Up @@ -1598,7 +1598,7 @@ static void rp_wait_until_sent(struct tty_struct *tty, int timeout)
if (signal_pending(current))
break;
}
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
#ifdef ROCKET_DEBUG_WAIT_UNTIL_SENT
printk(KERN_INFO "txcnt = %d (jiff=%lu)...done\n", txcnt, jiffies);
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ static ssize_t rtc_read(struct file *file, char __user *buf,
if (!retval)
retval = count;
out:
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
remove_wait_queue(&rtc_wait, &wait);

return retval;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ int paste_selection(struct tty_struct *tty)
pasted += count;
}
remove_wait_queue(&vc->paste_wait, &wait);
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);

tty_ldisc_deref(ld);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/serial167.c
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
#endif
schedule();
}
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
remove_wait_queue(&info->open_wait, &wait);
if (!tty_hung_up_p(filp)) {
info->count++;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/vt_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ int vt_waitactive(int vt)
schedule();
}
remove_wait_queue(&vt_activate_queue, &wait);
current->state = TASK_RUNNING;
__set_current_state(TASK_RUNNING);
return retval;
}

Expand Down

0 comments on commit cc0a8fb

Please sign in to comment.