tty_ioctl: drag screaming into compliance with the coding style

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:48 -08:00
committed by Linus Torvalds
parent 37bdfb074e
commit 355d95a1c8

View File

@@ -67,7 +67,6 @@ void tty_wait_until_sent(struct tty_struct * tty, long timeout)
if (tty->driver->wait_until_sent) if (tty->driver->wait_until_sent)
tty->driver->wait_until_sent(tty, timeout); tty->driver->wait_until_sent(tty, timeout);
} }
EXPORT_SYMBOL(tty_wait_until_sent); EXPORT_SYMBOL(tty_wait_until_sent);
static void unset_locked_termios(struct ktermios *termios, static void unset_locked_termios(struct ktermios *termios,
@@ -163,7 +162,6 @@ speed_t tty_termios_baud_rate(struct ktermios *termios)
} }
return baud_table[cbaud]; return baud_table[cbaud];
} }
EXPORT_SYMBOL(tty_termios_baud_rate); EXPORT_SYMBOL(tty_termios_baud_rate);
/** /**
@@ -203,7 +201,6 @@ speed_t tty_termios_input_baud_rate(struct ktermios *termios)
return tty_termios_baud_rate(termios); return tty_termios_baud_rate(termios);
#endif #endif
} }
EXPORT_SYMBOL(tty_termios_input_baud_rate); EXPORT_SYMBOL(tty_termios_input_baud_rate);
/** /**
@@ -338,7 +335,6 @@ speed_t tty_get_baud_rate(struct tty_struct *tty)
return baud; return baud;
} }
EXPORT_SYMBOL(tty_get_baud_rate); EXPORT_SYMBOL(tty_get_baud_rate);
/** /**
@@ -361,7 +357,6 @@ void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old)
new->c_ispeed = old->c_ispeed; new->c_ispeed = old->c_ispeed;
new->c_ospeed = old->c_ospeed; new->c_ospeed = old->c_ospeed;
} }
EXPORT_SYMBOL(tty_termios_copy_hw); EXPORT_SYMBOL(tty_termios_copy_hw);
/** /**
@@ -501,8 +496,8 @@ static int set_termios(struct tty_struct * tty, void __user *arg, int opt)
return -EFAULT; return -EFAULT;
#endif #endif
/* If old style Bfoo values are used then load c_ispeed/c_ospeed with the real speed /* If old style Bfoo values are used then load c_ispeed/c_ospeed
so its unconditionally usable */ * with the real speed so its unconditionally usable */
tmp_termios.c_ispeed = tty_termios_input_baud_rate(&tmp_termios); tmp_termios.c_ispeed = tty_termios_input_baud_rate(&tmp_termios);
tmp_termios.c_ospeed = tty_termios_baud_rate(&tmp_termios); tmp_termios.c_ospeed = tty_termios_baud_rate(&tmp_termios);
@@ -651,7 +646,8 @@ static int set_sgttyb(struct tty_struct * tty, struct sgttyb __user * sgttyb)
set_sgflags(&termios, tmp.sg_flags); set_sgflags(&termios, tmp.sg_flags);
/* Try and encode into Bfoo format */ /* Try and encode into Bfoo format */
#ifdef BOTHER #ifdef BOTHER
tty_termios_encode_baud_rate(&termios, termios.c_ispeed, termios.c_ospeed); tty_termios_encode_baud_rate(&termios, termios.c_ispeed,
termios.c_ospeed);
#endif #endif
mutex_unlock(&tty->termios_mutex); mutex_unlock(&tty->termios_mutex);
change_termios(tty, &termios); change_termios(tty, &termios);
@@ -695,9 +691,11 @@ static int get_ltchars(struct tty_struct * tty, struct ltchars __user * ltchars)
struct ltchars tmp; struct ltchars tmp;
tmp.t_suspc = tty->termios->c_cc[VSUSP]; tmp.t_suspc = tty->termios->c_cc[VSUSP];
tmp.t_dsuspc = tty->termios->c_cc[VSUSP]; /* what is dsuspc anyway? */ /* what is dsuspc anyway? */
tmp.t_dsuspc = tty->termios->c_cc[VSUSP];
tmp.t_rprntc = tty->termios->c_cc[VREPRINT]; tmp.t_rprntc = tty->termios->c_cc[VREPRINT];
tmp.t_flushc = tty->termios->c_cc[VEOL2]; /* what is flushc anyway? */ /* what is flushc anyway? */
tmp.t_flushc = tty->termios->c_cc[VEOL2];
tmp.t_werasc = tty->termios->c_cc[VWERASE]; tmp.t_werasc = tty->termios->c_cc[VWERASE];
tmp.t_lnextc = tty->termios->c_cc[VLNEXT]; tmp.t_lnextc = tty->termios->c_cc[VLNEXT];
return copy_to_user(ltchars, &tmp, sizeof(tmp)) ? -EFAULT : 0; return copy_to_user(ltchars, &tmp, sizeof(tmp)) ? -EFAULT : 0;
@@ -711,9 +709,11 @@ static int set_ltchars(struct tty_struct * tty, struct ltchars __user * ltchars)
return -EFAULT; return -EFAULT;
tty->termios->c_cc[VSUSP] = tmp.t_suspc; tty->termios->c_cc[VSUSP] = tmp.t_suspc;
tty->termios->c_cc[VEOL2] = tmp.t_dsuspc; /* what is dsuspc anyway? */ /* what is dsuspc anyway? */
tty->termios->c_cc[VEOL2] = tmp.t_dsuspc;
tty->termios->c_cc[VREPRINT] = tmp.t_rprntc; tty->termios->c_cc[VREPRINT] = tmp.t_rprntc;
tty->termios->c_cc[VEOL2] = tmp.t_flushc; /* what is flushc anyway? */ /* what is flushc anyway? */
tty->termios->c_cc[VEOL2] = tmp.t_flushc;
tty->termios->c_cc[VWERASE] = tmp.t_werasc; tty->termios->c_cc[VWERASE] = tmp.t_werasc;
tty->termios->c_cc[VLNEXT] = tmp.t_lnextc; tty->termios->c_cc[VLNEXT] = tmp.t_lnextc;
return 0; return 0;
@@ -833,11 +833,11 @@ int tty_mode_ioctl(struct tty_struct * tty, struct file *file,
if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked)) if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked))
return -EFAULT; return -EFAULT;
return 0; return 0;
case TIOCSLCKTRMIOS: case TIOCSLCKTRMIOS:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg)) if (user_termios_to_kernel_termios(real_tty->termios_locked,
(struct termios __user *) arg))
return -EFAULT; return -EFAULT;
return 0; return 0;
#else #else
@@ -845,16 +845,17 @@ int tty_mode_ioctl(struct tty_struct * tty, struct file *file,
if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked)) if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked))
return -EFAULT; return -EFAULT;
return 0; return 0;
case TIOCSLCKTRMIOS: case TIOCSLCKTRMIOS:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg)) if (user_termios_to_kernel_termios_1(real_tty->termios_locked,
(struct termios __user *) arg))
return -EFAULT; return -EFAULT;
return 0; return 0;
#endif #endif
case TIOCGSOFTCAR: case TIOCGSOFTCAR:
return put_user(C_CLOCAL(tty) ? 1 : 0, (int __user *)arg); return put_user(C_CLOCAL(tty) ? 1 : 0,
(int __user *)arg);
case TIOCSSOFTCAR: case TIOCSSOFTCAR:
if (get_user(arg, (unsigned int __user *) arg)) if (get_user(arg, (unsigned int __user *) arg))
return -EFAULT; return -EFAULT;
@@ -868,7 +869,6 @@ int tty_mode_ioctl(struct tty_struct * tty, struct file *file,
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
} }
EXPORT_SYMBOL_GPL(tty_mode_ioctl); EXPORT_SYMBOL_GPL(tty_mode_ioctl);
int tty_perform_flush(struct tty_struct *tty, unsigned long arg) int tty_perform_flush(struct tty_struct *tty, unsigned long arg)
@@ -899,7 +899,6 @@ int tty_perform_flush(struct tty_struct *tty, unsigned long arg)
tty_ldisc_deref(ld); tty_ldisc_deref(ld);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(tty_perform_flush); EXPORT_SYMBOL_GPL(tty_perform_flush);
int n_tty_ioctl(struct tty_struct *tty, struct file *file, int n_tty_ioctl(struct tty_struct *tty, struct file *file,
@@ -978,5 +977,4 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
return tty_mode_ioctl(tty, file, cmd, arg); return tty_mode_ioctl(tty, file, cmd, arg);
} }
} }
EXPORT_SYMBOL(n_tty_ioctl); EXPORT_SYMBOL(n_tty_ioctl);