tty: hvcs: simplify if-if to if-else
authorWan Jiabing <wanjiabing@vivo.com>
Sun, 24 Apr 2022 09:13:08 +0000 (17:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Apr 2022 11:24:22 +0000 (13:24 +0200)
Use if and else instead of if(A) and if (!A) and fix a coding style.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Link: https://lore.kernel.org/r/20220424091310.98780-1-wanjiabing@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/hvc/hvcs.c

index 245da1dfd81899cd9b643ddd410d9f223e77dc56..9b7e8246a464a98a5bab02f4bdf6c4e071e5c3fc 100644 (file)
@@ -581,10 +581,9 @@ static int hvcs_io(struct hvcs_struct *hvcsd)
 
        spin_unlock_irqrestore(&hvcsd->lock, flags);
        /* This is synch -- FIXME :js: it is not! */
-       if(got)
+       if (got)
                tty_flip_buffer_push(&hvcsd->port);
-
-       if (!got) {
+       else {
                /* Do this _after_ the flip_buffer_push */
                spin_lock_irqsave(&hvcsd->lock, flags);
                vio_enable_interrupts(hvcsd->vdev);