From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5904C169C4 for ; Thu, 31 Jan 2019 18:11:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9617218AF for ; Thu, 31 Jan 2019 18:11:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728089AbfAaSLo (ORCPT ); Thu, 31 Jan 2019 13:11:44 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49206 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfAaSLo (ORCPT ); Thu, 31 Jan 2019 13:11:44 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C435A78; Thu, 31 Jan 2019 10:11:43 -0800 (PST) Received: from [10.1.25.162] (e121487-lin.cambridge.arm.com [10.1.25.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C52693F59C; Thu, 31 Jan 2019 10:11:41 -0800 (PST) Subject: Re: [PATCH] serial: mps2-uart: Add parentheses around conditional in mps2_uart_shutdown To: Nathan Chancellor , Greg Kroah-Hartman Cc: Jiri Slaby , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nick Desaulniers References: <20190131180627.19944-1-natechancellor@gmail.com> From: Vladimir Murzin Message-ID: <6ae1916a-c18f-d2f2-705a-549c4468f81e@arm.com> Date: Thu, 31 Jan 2019 18:11:40 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190131180627.19944-1-natechancellor@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/31/19 6:06 PM, Nathan Chancellor wrote: > 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 > --- > 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); > } > Acked-by: Vladimir Murzin