n_tty: clean up old code to follow coding style and (mostly) checkpatch

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Alan Cox 2008-02-08 04:18:44 -08:00 committed by Linus Torvalds
parent db1acaa632
commit 4edf1827ea

View file

@ -662,9 +662,8 @@ static inline void n_tty_receive_overrun(struct tty_struct *tty)
static inline void n_tty_receive_parity_error(struct tty_struct *tty,
unsigned char c)
{
if (I_IGNPAR(tty)) {
if (I_IGNPAR(tty))
return;
}
if (I_PARMRK(tty)) {
put_tty_queue('\377', tty);
put_tty_queue('\0', tty);
@ -898,12 +897,10 @@ send_signal:
static void n_tty_write_wakeup(struct tty_struct *tty)
{
if (tty->fasync)
{
if (tty->fasync) {
set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
kill_fasync(&tty->fasync, SIGIO, POLL_OUT);
}
return;
}
/**
@ -968,7 +965,7 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
n_tty_receive_overrun(tty);
break;
default:
printk("%s: unknown flag %d\n",
printk(KERN_ERR "%s: unknown flag %d\n",
tty_name(tty, buf), flags);
break;
}
@ -1186,7 +1183,8 @@ static int copy_from_read_buf(struct tty_struct *tty,
return retval;
}
extern ssize_t redirected_tty_write(struct file *,const char *,size_t,loff_t *);
extern ssize_t redirected_tty_write(struct file *, const char *,
size_t, loff_t *);
/**
* job_control - check job control
@ -1208,7 +1206,7 @@ static int job_control(struct tty_struct *tty, struct file *file)
if (file->f_op->write != redirected_tty_write &&
current->signal->tty == tty) {
if (!tty->pgrp)
printk("read_chan: no tty->pgrp!\n");
printk(KERN_ERR "read_chan: no tty->pgrp!\n");
else if (task_pgrp(current) != tty->pgrp) {
if (is_ignored(SIGTTIN) ||
is_current_pgrp_orphaned())
@ -1252,7 +1250,7 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file,
do_it_again:
if (!tty->read_buf) {
printk("n_tty_read_chan: called with read_buf == NULL?!?\n");
printk(KERN_ERR "n_tty_read_chan: read_buf == NULL?!?\n");
return -EIO;
}
@ -1287,8 +1285,7 @@ do_it_again:
if (file->f_flags & O_NONBLOCK) {
if (!mutex_trylock(&tty->atomic_read_lock))
return -EAGAIN;
}
else {
} else {
if (mutex_lock_interruptible(&tty->atomic_read_lock))
return -ERESTARTSYS;
}
@ -1543,7 +1540,8 @@ break_out:
* a read wakeup to fix this bug.
*/
static unsigned int normal_poll(struct tty_struct * tty, struct file * file, poll_table *wait)
static unsigned int normal_poll(struct tty_struct *tty, struct file *file,
poll_table *wait)
{
unsigned int mask = 0;