Skip to content

Commit

Permalink
serial: mps2-uart: Add parentheses around conditional in mps2_uart_sh…
Browse files Browse the repository at this point in the history
…utdown

Clang warns:

drivers/tty/serial/mps2-uart.c:351:6: warning: logical not is only
applied to the left hand side of this bitwise operator
[-Wlogical-not-parentheses]
        if (!mps_port->flags & UART_PORT_COMBINED_IRQ) {
            ^                ~
drivers/tty/serial/mps2-uart.c:351:6: note: add parentheses after the
'!' to evaluate the bitwise operator first
        if (!mps_port->flags & UART_PORT_COMBINED_IRQ) {
            ^
             (                                       )
drivers/tty/serial/mps2-uart.c:351:6: note: add parentheses around left
hand side expression to silence this warning
        if (!mps_port->flags & UART_PORT_COMBINED_IRQ) {
            ^
            (               )
1 warning generated.

As it was intended for this check to be the inverse of the one at the
bottom of mps2_init_port, add parentheses around the whole conditional.

Fixes: 775ea4e ("serial: mps2-uart: support combined irq")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Vladimir Murzin <vladimir.murzin@arm.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/344
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Nathan Chancellor authored and Greg Kroah-Hartman committed Jan 31, 2019
1 parent 7ab57b7 commit 9c6a258
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/mps2-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ static void mps2_uart_shutdown(struct uart_port *port)

mps2_uart_write8(port, control, UARTn_CTRL);

if (!mps_port->flags & UART_PORT_COMBINED_IRQ) {
if (!(mps_port->flags & UART_PORT_COMBINED_IRQ)) {
free_irq(mps_port->rx_irq, mps_port);
free_irq(mps_port->tx_irq, mps_port);
}
Expand Down

0 comments on commit 9c6a258

Please sign in to comment.