Commit 4dbf9bed187b366ece04e6e15fd2cc918270f815
Committed by
Tom Rini
1 parent
7ba50418b9
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
serial: ns16550: Fix style violation
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>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
drivers/serial/ns16550.c
... | ... | @@ -339,9 +339,9 @@ |
339 | 339 | struct NS16550 *const com_port = dev_get_priv(dev); |
340 | 340 | |
341 | 341 | if (input) |
342 | - return serial_in(&com_port->lsr) & UART_LSR_DR ? 1 : 0; | |
342 | + return (serial_in(&com_port->lsr) & UART_LSR_DR) ? 1 : 0; | |
343 | 343 | else |
344 | - return serial_in(&com_port->lsr) & UART_LSR_THRE ? 0 : 1; | |
344 | + return (serial_in(&com_port->lsr) & UART_LSR_THRE) ? 0 : 1; | |
345 | 345 | } |
346 | 346 | |
347 | 347 | static int ns16550_serial_getc(struct udevice *dev) |