tty: Return bool from tty_termios_hw_change()
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 17 Jan 2023 09:03:56 +0000 (11:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2023 15:04:35 +0000 (16:04 +0100)
Change tty_termios_hw_change() to return bool.

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230117090358.4796-11-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_ioctl.c
include/linux/tty.h

index ce511557b98b1f6c58f9b9e608693fbe0c00fd76..12983ce4e43efb38f1458ff165d6f7a9d5b81d35 100644 (file)
@@ -270,13 +270,13 @@ EXPORT_SYMBOL(tty_termios_copy_hw);
  *     between the two termios structures, or a speed change is needed.
  */
 
-int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b)
+bool tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b)
 {
        if (a->c_ispeed != b->c_ispeed || a->c_ospeed != b->c_ospeed)
-               return 1;
+               return true;
        if ((a->c_cflag ^ b->c_cflag) & ~(HUPCL | CREAD | CLOCAL))
-               return 1;
-       return 0;
+               return true;
+       return false;
 }
 EXPORT_SYMBOL(tty_termios_hw_change);
 
index 730c3301d7101474f1dac3ca26c5747efcb4687b..093935e97f42278967a2848b61e238541a3b7825 100644 (file)
@@ -453,7 +453,7 @@ unsigned char tty_get_char_size(unsigned int cflag);
 unsigned char tty_get_frame_size(unsigned int cflag);
 
 void tty_termios_copy_hw(struct ktermios *new, const struct ktermios *old);
-int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b);
+bool tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b);
 int tty_set_termios(struct tty_struct *tty, struct ktermios *kt);
 
 void tty_wakeup(struct tty_struct *tty);