serial: move WARN_ON() in uart_write() to the condition
authorJiri Slaby <jirislaby@kernel.org>
Mon, 31 Jul 2023 08:02:35 +0000 (10:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Jul 2023 15:16:04 +0000 (17:16 +0200)
commit602c802114a10cb03415fbed0163ca9ff97fc5d4
tree3a9a1d65ca0114939610ea783c1a02437452e4d6
parentfe3015748a905e08eb0e1750aa2928f520063d59
serial: move WARN_ON() in uart_write() to the condition

uart code currently does the following in uart_write() and
uart_flush_buffer():
  if (cond) {
    WARN_ON(1);
    return;
  }

It can be rewritten to more obvious and more readable:
  if (WARN_ON(cond))
    return;

Do so.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230731080244.2698-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c