serial: jsm: Use B0 instead of 0
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 13 May 2022 08:29:06 +0000 (11:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 May 2022 16:26:17 +0000 (18:26 +0200)
Use B0 to check zero baudrate rather than literal 0.

While at it, remove extra parenthesis around CBAUD.

Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220513082906.11096-6-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/jsm/jsm_cls.c
drivers/tty/serial/jsm/jsm_neo.c

index 046b624..3fd57ac 100644 (file)
@@ -689,7 +689,7 @@ static void cls_param(struct jsm_channel *ch)
        /*
         * If baud rate is zero, flush queues, and set mval to drop DTR.
         */
-       if ((ch->ch_c_cflag & (CBAUD)) == 0) {
+       if ((ch->ch_c_cflag & CBAUD) == B0) {
                ch->ch_r_head = 0;
                ch->ch_r_tail = 0;
                ch->ch_e_head = 0;
index 0cf586c..0c78f66 100644 (file)
@@ -938,7 +938,7 @@ static void neo_param(struct jsm_channel *ch)
        /*
         * If baud rate is zero, flush queues, and set mval to drop DTR.
         */
-       if ((ch->ch_c_cflag & (CBAUD)) == 0) {
+       if ((ch->ch_c_cflag & CBAUD) == B0) {
                ch->ch_r_head = ch->ch_r_tail = 0;
                ch->ch_e_head = ch->ch_e_tail = 0;