diff mbox series

[U-Boot,RESEND,v2,2/4] serial: ns16550: Fix style violation

Message ID 20180115100949.20887-1-mario.six@gdsys.cc
State Accepted
Delegated to: Tom Rini
Headers show
Series None | expand

Commit Message

Mario Six Jan. 15, 2018, 10:09 a.m. UTC
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>
---

v1 -> v2:
None

---
 drivers/serial/ns16550.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.11.0

Comments

Tom Rini Jan. 28, 2018, 6:52 p.m. UTC | #1
On Mon, Jan 15, 2018 at 11:09:49AM +0100, Mario Six wrote:

> 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>

Applied to u-boot/master, thanks!
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)