n_tty: make n_tty_receive_char_special return void
authorJiri Slaby <jslaby@suse.cz>
Wed, 5 May 2021 09:19:00 +0000 (11:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 May 2021 14:57:16 +0000 (16:57 +0200)
After the previous patch, noone cares about the return value of
n_tty_receive_char_special. ldata->lnext is checked instead.

So switch return type of n_tty_receive_char_special to void.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210505091928.22010-8-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c

index d40844b7a4fbcc70a461b70ba57bf4a6c682c684..b8f981499465a4c46d3e5429dc5fc2e572c14dcf 100644 (file)
@@ -1260,12 +1260,8 @@ n_tty_receive_signal_char(struct tty_struct *tty, int signal, unsigned char c)
  *     n_tty_receive_buf()/producer path:
  *             caller holds non-exclusive termios_rwsem
  *             publishes canon_head if canonical mode is active
- *
- *     Returns 1 if LNEXT was received, else returns 0
  */
-
-static int
-n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
+static void n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
 {
        struct n_tty_data *ldata = tty->disc_data;
 
@@ -1273,24 +1269,24 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
                if (c == START_CHAR(tty)) {
                        start_tty(tty);
                        process_echoes(tty);
-                       return 0;
+                       return;
                }
                if (c == STOP_CHAR(tty)) {
                        stop_tty(tty);
-                       return 0;
+                       return;
                }
        }
 
        if (L_ISIG(tty)) {
                if (c == INTR_CHAR(tty)) {
                        n_tty_receive_signal_char(tty, SIGINT, c);
-                       return 0;
+                       return;
                } else if (c == QUIT_CHAR(tty)) {
                        n_tty_receive_signal_char(tty, SIGQUIT, c);
-                       return 0;
+                       return;
                } else if (c == SUSP_CHAR(tty)) {
                        n_tty_receive_signal_char(tty, SIGTSTP, c);
-                       return 0;
+                       return;
                }
        }
 
@@ -1301,7 +1297,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
 
        if (c == '\r') {
                if (I_IGNCR(tty))
-                       return 0;
+                       return;
                if (I_ICRNL(tty))
                        c = '\n';
        } else if (c == '\n' && I_INLCR(tty))
@@ -1312,7 +1308,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
                    (c == WERASE_CHAR(tty) && L_IEXTEN(tty))) {
                        eraser(c, tty);
                        commit_echoes(tty);
-                       return 0;
+                       return;
                }
                if (c == LNEXT_CHAR(tty) && L_IEXTEN(tty)) {
                        ldata->lnext = 1;
@@ -1324,7 +1320,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
                                        commit_echoes(tty);
                                }
                        }
-                       return 1;
+                       return;
                }
                if (c == REPRINT_CHAR(tty) && L_ECHO(tty) && L_IEXTEN(tty)) {
                        size_t tail = ldata->canon_head;
@@ -1337,7 +1333,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c)
                                tail++;
                        }
                        commit_echoes(tty);
-                       return 0;
+                       return;
                }
                if (c == '\n') {
                        if (L_ECHO(tty) || L_ECHONL(tty)) {
@@ -1375,7 +1371,7 @@ handle_newline:
                        smp_store_release(&ldata->canon_head, ldata->read_head);
                        kill_fasync(&tty->fasync, SIGIO, POLL_IN);
                        wake_up_interruptible_poll(&tty->read_wait, EPOLLIN);
-                       return 0;
+                       return;
                }
        }
 
@@ -1397,7 +1393,6 @@ handle_newline:
                put_tty_queue(c, ldata);
 
        put_tty_queue(c, ldata);
-       return 0;
 }
 
 static void n_tty_receive_char(struct tty_struct *tty, unsigned char c)