diff mbox series

[U-Boot,030/080] serial: ns16550: Fix style violation

Message ID 20170929125238.26226-30-mario.six@gdsys.cc
State Accepted
Commit 4dbf9bed187b366ece04e6e15fd2cc918270f815
Delegated to: Wolfgang Denk
Headers show
Series [U-Boot,001/080] mpc8308rdb: Fix style violation | expand

Commit Message

Mario Six Sept. 29, 2017, 12:51 p.m. UTC
Clarify the computation precedence in two ternary operator
constructions.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
---
 drivers/serial/ns16550.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Glass Oct. 9, 2017, 4:48 a.m. UTC | #1
On 29 September 2017 at 06:51, Mario Six <mario.six@gdsys.cc> wrote:
> Clarify the computation precedence in two ternary operator
> constructions.
>
> Signed-off-by: Mario Six <mario.six@gdsys.cc>
> ---
>  drivers/serial/ns16550.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index c702304e79..6f9ce689cf 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -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)