Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: remove redundant condition checks

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>

authored by

Xichao Zhao and committed by
Greg Kroah-Hartman
b601e1f4 da7e8b38

+2 -2
+1 -1
drivers/tty/hvc/hvc_console.c
··· 184 184 hvc_console_flush(cons_ops[index], 185 185 vtermnos[index]); 186 186 } 187 - } else if (r > 0) { 187 + } else { 188 188 i -= r; 189 189 if (i > 0) 190 190 memmove(c, c+r, i);
+1 -1
drivers/tty/serial/msm_serial.c
··· 1102 1102 1103 1103 if (result == baud) 1104 1104 break; 1105 - } else if (entry->divisor > divisor) { 1105 + } else { 1106 1106 old = target; 1107 1107 target = clk_round_rate(msm_port->clk, old + 1); 1108 1108 /*