lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190131180627.19944-1-natechancellor@gmail.com>
Date:   Thu, 31 Jan 2019 11:06:28 -0700
From:   Nathan Chancellor <natechancellor@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Vladimir Murzin <vladimir.murzin@....com>
Cc:     Jiri Slaby <jslaby@...e.com>, Liviu Dudau <liviu.dudau@....com>,
        Sudeep Holla <sudeep.holla@....com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        linux-serial@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nathan Chancellor <natechancellor@...il.com>
Subject: [PATCH] serial: mps2-uart: Add parentheses around conditional in mps2_uart_shutdown

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: 775ea4ea2fd9 ("serial: mps2-uart: support combined irq")
Signed-off-by: Nathan Chancellor <natechancellor@...il.com>
---
 drivers/tty/serial/mps2-uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/mps2-uart.c b/drivers/tty/serial/mps2-uart.c
index 4404eb7d118f..587b42f754cb 100644
--- a/drivers/tty/serial/mps2-uart.c
+++ b/drivers/tty/serial/mps2-uart.c
@@ -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);
 	}
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ