Skip to contentSkip to conversation

serial: ns16550: Fix style violation

PATCH RESEND New Mario Six 2 participants 2 messages Jan 15, 2018 – Jan 28, 2018

lore
Share & tools
lore

Mario Six

author
#0 lore raw

PATCH RESEND v2 2/4 serial: ns16550: Fix style violation

Clarify the computation precedence in two ternary operator constructions.

---

v1 -> v2:
None

---
 drivers/serial/ns16550.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/serial/ns16550.c +2 -2
index c702304e79..6f9ce689cf 100644
@@ -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)

--
2.11.0

#1 lore raw

PATCH RESEND v2 2/4 serial: ns16550: Fix style violation

Quoted 5 lines · Mario Six

Clarify the computation precedence in two ternary operator constructions.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180128/920ac6e7/attachment.sig>