Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3465385rwa; Tue, 23 Aug 2022 05:20:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR7hW/E8CWKOpZfcrHcF0mKLQxDFFq7C+eZBUSEo/IzeQj23sA/JfrIHxGN7Wm3F6O9Omcn+ X-Received: by 2002:a63:88c7:0:b0:429:a566:e534 with SMTP id l190-20020a6388c7000000b00429a566e534mr20544991pgd.517.1661257214751; Tue, 23 Aug 2022 05:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257214; cv=none; d=google.com; s=arc-20160816; b=GNNj+XJ+DTd7hCYJtMsvGwAcuRNgWLRT7fj7EnaURDqjMNaBiu3SdNEU5oIthVpZF8 KCmQFdKAoHov6+NE/ERFC04L1MCxw/XwdyxLusNYv9iM7NksN8AaUc7/WHNwChkB4xXL +pdlHscEYfQYyvdypIZaw/ek/ru11iTTdtk8ttw/YLik4v26PofjgXBpTxhKlQpvXgl3 X9PeXYhjhQjitQH0k4N4thR5IM34p6WmyK8t/BZtEu/b1Va94AU+fxanZ6uHeyN78ewe Hkrvcmrytr4T5XXjOpie+E0rCenRk3jiFXB8HqNPLWdoORGoFI6lxKgSy26Fh6yG4Zvz 2I6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9p/gcbjvHaYZlrn0D/JIwh2VUETPG1PVHucQUTzpx3I=; b=KZsMOXJOhOxmvc9bLD2YWpLld6iUPMx0VRDmK8CkeDYMK2jiTrigGOEjgB/KEVa/m9 PIbrZ7wwOs6lTrxKomVo59MdbvzJgV8u5s7XP79EsZtM9nyR/bFWYmbI1cOBOnWaeHDq v31nwwLHoWWTAWlWGQ8+AznxjRyX8cMX7NkyMTH8tV3wyxzx0lxiKr7+5Hddx72pPXAP o9PTmvY/LqblIcfbPkZIBkrG4rcL8EgP8ASOQJt1PHTh7aH877wtJRXP4QqkTun44enJ fD8b139iHs2Nsb4h3p6g6ZLIkub2wgDDYeqtG9SNXFaBm12wgD3vLcy/LDCE/F6q0bsk h0ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ycas1gfI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m24-20020a63f618000000b0041d1f8dced1si11718248pgh.868.2022.08.23.05.20.04; Tue, 23 Aug 2022 05:20:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ycas1gfI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355980AbiHWKsq (ORCPT + 99 others); Tue, 23 Aug 2022 06:48:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356406AbiHWKmK (ORCPT ); Tue, 23 Aug 2022 06:42:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B31C86043; Tue, 23 Aug 2022 02:09:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 341B6B81C86; Tue, 23 Aug 2022 09:09:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D989C433C1; Tue, 23 Aug 2022 09:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245772; bh=ttLvW3MfLOd5HkB/xUpnfI6bCZM/YFhvYh+VBRclgbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ycas1gfIgfnrj2m6r3kOaVTths3vqe4YTewEhbduTZgYxRLwR5aIVI4wGszLUArww mOC61upZpqqYlb1hmeIRohndTZ+74yRs2wcy+EKlY2DjNJSCGp92wypUvFTEbXRC6W GeU8PtwgOyIj7VA0fQ2Tk8SJviKUAkeHC6P9Msjk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guenter Roeck , kernel test robot , Alexander Lobakin , Yury Norov Subject: [PATCH 4.19 185/287] x86/olpc: fix logical not is only applied to the left hand side Date: Tue, 23 Aug 2022 10:25:54 +0200 Message-Id: <20220823080107.028915457@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Lobakin commit 3a2ba42cbd0b669ce3837ba400905f93dd06c79f upstream. The bitops compile-time optimization series revealed one more problem in olpc-xo1-sci.c:send_ebook_state(), resulted in GCC warnings: arch/x86/platform/olpc/olpc-xo1-sci.c: In function 'send_ebook_state': arch/x86/platform/olpc/olpc-xo1-sci.c:83:63: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] 83 | if (!!test_bit(SW_TABLET_MODE, ebook_switch_idev->sw) == state) | ^~ arch/x86/platform/olpc/olpc-xo1-sci.c:83:13: note: add parentheses around left hand side expression to silence this warning Despite this code working as intended, this redundant double negation of boolean value, together with comparing to `char` with no explicit conversion to bool, makes compilers think the author made some unintentional logical mistakes here. Make it the other way around and negate the char instead to silence the warnings. Fixes: d2aa37411b8e ("x86/olpc/xo1/sci: Produce wakeup events for buttons and switches") Cc: stable@vger.kernel.org # 3.5+ Reported-by: Guenter Roeck Reported-by: kernel test robot Reviewed-and-tested-by: Guenter Roeck Signed-off-by: Alexander Lobakin Signed-off-by: Yury Norov Signed-off-by: Greg Kroah-Hartman --- arch/x86/platform/olpc/olpc-xo1-sci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/platform/olpc/olpc-xo1-sci.c +++ b/arch/x86/platform/olpc/olpc-xo1-sci.c @@ -85,7 +85,7 @@ static void send_ebook_state(void) return; } - if (!!test_bit(SW_TABLET_MODE, ebook_switch_idev->sw) == state) + if (test_bit(SW_TABLET_MODE, ebook_switch_idev->sw) == !!state) return; /* Nothing new to report. */ input_report_switch(ebook_switch_idev, SW_TABLET_MODE, state);