From: Xichao Zhao Date: Fri, 5 Sep 2025 09:13:21 +0000 (+0800) Subject: tty: remove redundant condition checks X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b601e1f41edd4667062aa7cccb4e5199814979a3;p=thirdparty%2Fkernel%2Fstable.git tty: remove redundant condition checks Remove redundant condition checks and replace else if with else. Signed-off-by: Xichao Zhao Reviewed-by: Christophe Leroy Link: https://lore.kernel.org/r/20250905091321.437476-1-zhao.xichao@vivo.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index cd1f657f782df..fffc30b9ea548 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c @@ -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); diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index 3449945493ceb..2e999cb9c9744 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -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); /*