]> git.karo-electronics.de Git - linux-beck.git/commitdiff
tty: Use 'disc' for line discipline index name
authorPeter Hurley <peter@hurleysoftware.com>
Mon, 11 Jan 2016 06:41:04 +0000 (22:41 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jan 2016 23:01:44 +0000 (15:01 -0800)
tty->ldisc is a ptr to struct tty_ldisc, but unfortunately 'ldisc' is
also used as a parameter or local name to refer to the line discipline
index value (ie, N_TTY, N_GSM, etc.); instead prefer the name used
by the line discipline registration/ref counting functions.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c
drivers/tty/tty_ldisc.c
include/linux/tty.h

index eb26754b2e5ddb949192f0da34596a5a82103e11..7f556e3c151594f9d447dcaf043b8dc5e03b4bd4 100644 (file)
@@ -2662,13 +2662,13 @@ static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t _
 
 static int tiocsetd(struct tty_struct *tty, int __user *p)
 {
-       int ldisc;
+       int disc;
        int ret;
 
-       if (get_user(ldisc, p))
+       if (get_user(disc, p))
                return -EFAULT;
 
-       ret = tty_set_ldisc(tty, ldisc);
+       ret = tty_set_ldisc(tty, disc);
 
        return ret;
 }
index eac33e104ccc29603de52b581a60e544c2dfca71..45aa31b923e524ab696e50c606242e5a23ae3ce5 100644 (file)
@@ -417,7 +417,7 @@ EXPORT_SYMBOL_GPL(tty_ldisc_flush);
 /**
  *     tty_set_termios_ldisc           -       set ldisc field
  *     @tty: tty structure
- *     @num: line discipline number
+ *     @disc: line discipline number
  *
  *     This is probably overkill for real world processors but
  *     they are not on hot paths so a little discipline won't do
@@ -430,10 +430,10 @@ EXPORT_SYMBOL_GPL(tty_ldisc_flush);
  *     Locking: takes termios_rwsem
  */
 
-static void tty_set_termios_ldisc(struct tty_struct *tty, int num)
+static void tty_set_termios_ldisc(struct tty_struct *tty, int disc)
 {
        down_write(&tty->termios_rwsem);
-       tty->termios.c_line = num;
+       tty->termios.c_line = disc;
        up_write(&tty->termios_rwsem);
 
        tty->disc_data = NULL;
@@ -531,12 +531,12 @@ static void tty_ldisc_restore(struct tty_struct *tty, struct tty_ldisc *old)
  *     the close of one side of a tty/pty pair, and eventually hangup.
  */
 
-int tty_set_ldisc(struct tty_struct *tty, int ldisc)
+int tty_set_ldisc(struct tty_struct *tty, int disc)
 {
        int retval;
        struct tty_ldisc *old_ldisc, *new_ldisc;
 
-       new_ldisc = tty_ldisc_get(tty, ldisc);
+       new_ldisc = tty_ldisc_get(tty, disc);
        if (IS_ERR(new_ldisc))
                return PTR_ERR(new_ldisc);
 
@@ -551,7 +551,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
        }
 
        /* Check the no-op case */
-       if (tty->ldisc->ops->num == ldisc)
+       if (tty->ldisc->ops->num == disc)
                goto out;
 
        if (test_bit(TTY_HUPPED, &tty->flags)) {
@@ -567,7 +567,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
 
        /* Now set up the new line discipline. */
        tty->ldisc = new_ldisc;
-       tty_set_termios_ldisc(tty, ldisc);
+       tty_set_termios_ldisc(tty, disc);
 
        retval = tty_ldisc_open(tty, new_ldisc);
        if (retval < 0) {
@@ -639,15 +639,15 @@ static void tty_reset_termios(struct tty_struct *tty)
 /**
  *     tty_ldisc_reinit        -       reinitialise the tty ldisc
  *     @tty: tty to reinit
- *     @ldisc: line discipline to reinitialize
+ *     @disc: line discipline to reinitialize
  *
  *     Switch the tty to a line discipline and leave the ldisc
  *     state closed
  */
 
-static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
+static int tty_ldisc_reinit(struct tty_struct *tty, int disc)
 {
-       struct tty_ldisc *ld = tty_ldisc_get(tty, ldisc);
+       struct tty_ldisc *ld = tty_ldisc_get(tty, disc);
 
        if (IS_ERR(ld))
                return -1;
@@ -658,7 +658,7 @@ static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
         *      Switch the line discipline back
         */
        tty->ldisc = ld;
-       tty_set_termios_ldisc(tty, ldisc);
+       tty_set_termios_ldisc(tty, disc);
 
        return 0;
 }
index 83f127673bc95b49aaad78235cd7035d83fb2863..e3b0afbde7b98a870fbd1f8a3430c5a41706f47f 100644 (file)
@@ -570,7 +570,7 @@ static inline int tty_port_users(struct tty_port *port)
 
 extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
 extern int tty_unregister_ldisc(int disc);
-extern int tty_set_ldisc(struct tty_struct *tty, int ldisc);
+extern int tty_set_ldisc(struct tty_struct *tty, int disc);
 extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty);
 extern void tty_ldisc_release(struct tty_struct *tty);
 extern void tty_ldisc_init(struct tty_struct *tty);