]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tty: remove redundant condition checks
authorXichao Zhao <zhao.xichao@vivo.com>
Fri, 5 Sep 2025 09:13:21 +0000 (17:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Sep 2025 13:49:58 +0000 (15:49 +0200)
Remove redundant condition checks and replace else if with else.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20250905091321.437476-1-zhao.xichao@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/hvc/hvc_console.c
drivers/tty/serial/msm_serial.c

index cd1f657f782df218b12e315dd3fdab79474d2bec..fffc30b9ea5487e8cfce4334ba84e1c90d18a399 100644 (file)
@@ -184,7 +184,7 @@ static void hvc_console_print(struct console *co, const char *b,
                                        hvc_console_flush(cons_ops[index],
                                                      vtermnos[index]);
                                }
-                       } else if (r > 0) {
+                       } else {
                                i -= r;
                                if (i > 0)
                                        memmove(c, c+r, i);
index 3449945493ceb42369d2acafca925350fccc4f82..2e999cb9c97447255c14d632ccbbbbfc65972f77 100644 (file)
@@ -1102,7 +1102,7 @@ msm_find_best_baud(struct uart_port *port, unsigned int baud,
 
                        if (result == baud)
                                break;
-               } else if (entry->divisor > divisor) {
+               } else {
                        old = target;
                        target = clk_round_rate(msm_port->clk, old + 1);
                        /*