serial: ns16550: Fix style violation
authorMario Six <mario.six@gdsys.cc>
Mon, 15 Jan 2018 10:09:49 +0000 (11:09 +0100)
committerTom Rini <trini@konsulko.com>
Sun, 28 Jan 2018 14:36:28 +0000 (09:36 -0500)
Clarify the computation precedence in two ternary operator
constructions.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
drivers/serial/ns16550.c

index c702304..6f9ce68 100644 (file)
@@ -339,9 +339,9 @@ static int ns16550_serial_pending(struct udevice *dev, bool input)
        struct NS16550 *const com_port = dev_get_priv(dev);
 
        if (input)
-               return serial_in(&com_port->lsr) & UART_LSR_DR ? 1 : 0;
+               return (serial_in(&com_port->lsr) & UART_LSR_DR) ? 1 : 0;
        else
-               return serial_in(&com_port->lsr) & UART_LSR_THRE ? 0 : 1;
+               return (serial_in(&com_port->lsr) & UART_LSR_THRE) ? 0 : 1;
 }
 
 static int ns16550_serial_getc(struct udevice *dev)