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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAC75C433EF for ; Tue, 21 Dec 2021 12:24:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237551AbhLUMYv (ORCPT ); Tue, 21 Dec 2021 07:24:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237531AbhLUMYu (ORCPT ); Tue, 21 Dec 2021 07:24:50 -0500 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43A99C061574 for ; Tue, 21 Dec 2021 04:24:50 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id x15so51415172edv.1 for ; Tue, 21 Dec 2021 04:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MoTPJgJK0kZOerSu3Jp9Zb+6CJ0WBkqc48qX6OzMzxM=; b=AcXpAvYJL3+SogW72d+2cvTlPfSSLhUoTiSJYa5yyLkarMdsABl5w9RwhqH0iPoECC 4p4Q/mmwahrfYNtqZ12rTk4/hzDdYnB55guBF4Q44fZDtSe82RNItbEG9yOy+0b3Ot7G qEJ2+P1ufHfLZti3MBwimSl/Xv7XCf8L4E1vk/mSyf5G5pW3ZNVxeQe6GCdBwFAv8cXO Ha/XIeQUkHoCvCpoAFWSKHdRfSekatwAOQaOyBqL2oo32p4dX7sWGj5vkdnQrFCcxWHV mRx7IzyAqKAOkfXnI9i/Gh5F0ZjhRjTSPnNljSTs/5BwuhtBlFmckI+QXGH5ohKnmIDo b9/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MoTPJgJK0kZOerSu3Jp9Zb+6CJ0WBkqc48qX6OzMzxM=; b=nsUzYSRSv+GYDii6nO/os36Zkf4RBCHZ/NgMgUf4e2AXDYUav+Vd9LrfH4PerULM2e DpbKlwetvZwlc2CsOogh8hBo1yv49grfWQUC28S+ZlmrvkzQTpcPg7kg2CC5Zyfq8iC7 gMymCyd7XI+jVu7VoZwxFSFy/cdPXq3hbQ4pRZUHNZSlmNuPlRRjgtCLGmflVhZTJG4/ bRpUn1T6hyQi5BFo+Wq+R+FgYWCzIC1uP4bYldrEc2H3a7bwlPAniS4JGT7jq8o2/TEm 94HuA3ufeF4mtjAYGm+mx/QZebU5SfWOXNn5ar6rE3NzdfM80FZsKpRr/d85j8VIjYea uvKg== X-Gm-Message-State: AOAM531wJnnEYZKq/gDPtWV+0f31zkrFhEi7VQKhLt7cZJx8AWqzMRmw Wud5uxprlJ4yt4dkK6VIsRzCEarb8RElveytX+h9Hw== X-Google-Smtp-Source: ABdhPJyj+NVUeXk90XBlkTzieM83fRys2s8IsWREHaLZ7Vl5Sxqah7M8SCVRkQ/IZz/fkjggv7qm9GS6vSi+KHPu/y8= X-Received: by 2002:a17:906:4904:: with SMTP id b4mr2606178ejq.174.1640089488801; Tue, 21 Dec 2021 04:24:48 -0800 (PST) MIME-Version: 1.0 References: <20211217144119.2538175-1-anders.roxell@linaro.org> <20211217144119.2538175-7-anders.roxell@linaro.org> In-Reply-To: From: Anders Roxell Date: Tue, 21 Dec 2021 13:24:38 +0100 Message-ID: Subject: Re: [PATCH 4.19 6/6] Input: touchscreen - avoid bitwise vs logical OR warning To: Greg KH Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, davem@davemloft.net, netdev@vger.kernel.org, linux-usb@vger.kernel.org, clang-built-linux@googlegroups.com, ulli.kroll@googlemail.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, amitkarwar@gmail.com, nishants@marvell.com, gbhat@marvell.com, huxinming820@gmail.com, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com, dmitry.torokhov@gmail.com, ndesaulniers@google.com, nathan@kernel.org, linux-input@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, 20 Dec 2021 at 11:59, Greg KH wrote: > > On Fri, Dec 17, 2021 at 03:41:19PM +0100, Anders Roxell wrote: > > From: Nathan Chancellor > > > > commit a02dcde595f7cbd240ccd64de96034ad91cffc40 upstream. > > > > A new warning in clang points out a few places in this driver where a > > bitwise OR is being used with boolean types: > > > > drivers/input/touchscreen.c:81:17: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] > > data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-x", > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > This use of a bitwise OR is intentional, as bitwise operations do not > > short circuit, which allows all the calls to touchscreen_get_prop_u32() > > to happen so that the last parameter is initialized while coalescing the > > results of the calls to make a decision after they are all evaluated. > > > > To make this clearer to the compiler, use the '|=' operator to assign > > the result of each touchscreen_get_prop_u32() call to data_present, > > which keeps the meaning of the code the same but makes it obvious that > > every one of these calls is expected to happen. > > > > Signed-off-by: Nathan Chancellor > > Reported-by: Nick Desaulniers > > Reviewed-by: Nick Desaulniers > > Link: https://lore.kernel.org/r/20211014205757.3474635-1-nathan@kernel.org > > Signed-off-by: Dmitry Torokhov > > Signed-off-by: Anders Roxell > > --- > > drivers/input/touchscreen/of_touchscreen.c | 18 +++++++++--------- > > 1 file changed, 9 insertions(+), 9 deletions(-) > > Also needed in 5.10.y and 5.4.y. > > Please be more careful next time. Yes I will, I'm sorry. Cheers, Anders 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 881BFC433F5 for ; Tue, 21 Dec 2021 12:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Aj+Lta1bddR1nUoWFQeTnY455dGbVqMHuYwWk1FrImQ=; b=TIZtCiSEPZHKGf xHXQPIIBLoULxQLgi0u2Huak+e1lp22JZCRRXsKGWr3Ty2rmzBECAC6MbdJtD9S8EaX/L2eBNeSQq mImlUBYV+tViTvj/992tzWUAjmQSvIjnZvGqjx4uiuw893W6bT8W7Me9CUGcjuM609oC4monndDej X8rtEXpmkn+uGHBjvd8K095CMup1ryrFlEAIPO7+FOyHiG1ys6D+mKI4sTtv6/FJWq9tBsfKHf5/i 9AwBUb2/vMw+sC2mPB2GYRp15fA8Nk3xvf/3sZSB+mEN2tcdFSaJLnPmGWK8wZwWYKSCpsXEadX2r Ai5F0Mgm4055rWXk3BWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzeCM-006lrt-Cs; Tue, 21 Dec 2021 12:24:54 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzeCI-006lqq-L5 for linux-arm-kernel@lists.infradead.org; Tue, 21 Dec 2021 12:24:52 +0000 Received: by mail-ed1-x52f.google.com with SMTP id o6so5164151edc.4 for ; Tue, 21 Dec 2021 04:24:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MoTPJgJK0kZOerSu3Jp9Zb+6CJ0WBkqc48qX6OzMzxM=; b=AcXpAvYJL3+SogW72d+2cvTlPfSSLhUoTiSJYa5yyLkarMdsABl5w9RwhqH0iPoECC 4p4Q/mmwahrfYNtqZ12rTk4/hzDdYnB55guBF4Q44fZDtSe82RNItbEG9yOy+0b3Ot7G qEJ2+P1ufHfLZti3MBwimSl/Xv7XCf8L4E1vk/mSyf5G5pW3ZNVxeQe6GCdBwFAv8cXO Ha/XIeQUkHoCvCpoAFWSKHdRfSekatwAOQaOyBqL2oo32p4dX7sWGj5vkdnQrFCcxWHV mRx7IzyAqKAOkfXnI9i/Gh5F0ZjhRjTSPnNljSTs/5BwuhtBlFmckI+QXGH5ohKnmIDo b9/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MoTPJgJK0kZOerSu3Jp9Zb+6CJ0WBkqc48qX6OzMzxM=; b=xBBZVGVqWYAcw/wmolOgZTy/btSaiOAVO2tfQgLRSGsXMWEYonwQnRZi/jM6kh7pDS 1OSZzO3w7mop+6d0FJD+g1uRTCGVBqvZDfnbF1454t5FhsJ6DooN+FreNSwrOZB9K1Vm ISS1uK8YkyZC6jyTj9YshptVKfiNnTAOE/K9jD/73G/mKm5F5OONdZ/09vFLWlDeGpPB ygEVAp5mIm2DWibwPgMlQbG2pCxoi09ChbvaUQokxqeGDmqDDAMEOXqN2P0feEgUd9uX HzZvv0QlFRHtUH4GnrPOLMBZL2ep5QHAgjHuBinlPeBbLD0v8Ttmg/aHazEVnO08/LqC N4vg== X-Gm-Message-State: AOAM530YAq+DFXqCLcQJXUOrp2ar3I6bTQTgqUnIqFuIoysi8WCTYFaS xS0xnvV2jp1fPSqzQv2heT33wqaNuUBHgKZ4J3tZjw== X-Google-Smtp-Source: ABdhPJyj+NVUeXk90XBlkTzieM83fRys2s8IsWREHaLZ7Vl5Sxqah7M8SCVRkQ/IZz/fkjggv7qm9GS6vSi+KHPu/y8= X-Received: by 2002:a17:906:4904:: with SMTP id b4mr2606178ejq.174.1640089488801; Tue, 21 Dec 2021 04:24:48 -0800 (PST) MIME-Version: 1.0 References: <20211217144119.2538175-1-anders.roxell@linaro.org> <20211217144119.2538175-7-anders.roxell@linaro.org> In-Reply-To: From: Anders Roxell Date: Tue, 21 Dec 2021 13:24:38 +0100 Message-ID: Subject: Re: [PATCH 4.19 6/6] Input: touchscreen - avoid bitwise vs logical OR warning To: Greg KH Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, davem@davemloft.net, netdev@vger.kernel.org, linux-usb@vger.kernel.org, clang-built-linux@googlegroups.com, ulli.kroll@googlemail.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, amitkarwar@gmail.com, nishants@marvell.com, gbhat@marvell.com, huxinming820@gmail.com, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com, dmitry.torokhov@gmail.com, ndesaulniers@google.com, nathan@kernel.org, linux-input@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211221_042450_790688_6EACFD11 X-CRM114-Status: GOOD ( 22.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 20 Dec 2021 at 11:59, Greg KH wrote: > > On Fri, Dec 17, 2021 at 03:41:19PM +0100, Anders Roxell wrote: > > From: Nathan Chancellor > > > > commit a02dcde595f7cbd240ccd64de96034ad91cffc40 upstream. > > > > A new warning in clang points out a few places in this driver where a > > bitwise OR is being used with boolean types: > > > > drivers/input/touchscreen.c:81:17: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] > > data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-x", > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > This use of a bitwise OR is intentional, as bitwise operations do not > > short circuit, which allows all the calls to touchscreen_get_prop_u32() > > to happen so that the last parameter is initialized while coalescing the > > results of the calls to make a decision after they are all evaluated. > > > > To make this clearer to the compiler, use the '|=' operator to assign > > the result of each touchscreen_get_prop_u32() call to data_present, > > which keeps the meaning of the code the same but makes it obvious that > > every one of these calls is expected to happen. > > > > Signed-off-by: Nathan Chancellor > > Reported-by: Nick Desaulniers > > Reviewed-by: Nick Desaulniers > > Link: https://lore.kernel.org/r/20211014205757.3474635-1-nathan@kernel.org > > Signed-off-by: Dmitry Torokhov > > Signed-off-by: Anders Roxell > > --- > > drivers/input/touchscreen/of_touchscreen.c | 18 +++++++++--------- > > 1 file changed, 9 insertions(+), 9 deletions(-) > > Also needed in 5.10.y and 5.4.y. > > Please be more careful next time. Yes I will, I'm sorry. Cheers, Anders _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel