Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3505792rwa; Tue, 23 Aug 2022 06:01:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR7JOKRnTbryxi7ZlG/8H1EPB6A5FmRen4wpgLGBx9pl+nE7L+8qb5EwsFD9TuFljS2uWu2L X-Received: by 2002:a17:907:d07:b0:72e:ec79:ad0f with SMTP id gn7-20020a1709070d0700b0072eec79ad0fmr16653235ejc.296.1661259663106; Tue, 23 Aug 2022 06:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661259663; cv=none; d=google.com; s=arc-20160816; b=GRD/zQlH83vGC8clPBSOR8/yBzJXTLBXJAEvSNb2IHKg6c9AxM4//PzOwgYI1wLA/z Kymqda3nyj8Prt+sOsR65uOjZk8tXyQWpkZeAQkfrmf7pbF/6Ib1oJBGmFSlCGnbGLP4 rDkuBnzrr4uXIA6XXQE9N6n6pSGgmnLtb2m+Q+9CjpsM8HPjn7RfLwWEJXDlMI0hZ+Nv dVAPqm0WRBhLBmLCmk6FZhdFcn1S6MwRwq7GsyqiC+4Pdc2c6HOZRWHe6YRSoPSBgNY6 MzeXVv8lOhgfgNqQAT5Ac9Rh3rdy3AWSMckTz6F7UQ0GmedoPvBJRZQFZvPq0+rJe+CR caqw== 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=tiL6snMkAgw5FXmROc1eyZFidFvLapyZWGM9h8pMGM8=; b=lkiWfbgkFB8+SWQTIG6anyfBavBwICrFTjoJCnEfiGC5+cZ0YQTf7HqKVbEMsjKcgv qlMIQ5tR9AkP20//BB3DMmkDTrCtIwsQKcGAsp8nzPdNwG0g3mi7krmvEczN6Yqrv7iN D+IGw+eBnMxjyur1P1xcbnsL0a60RUYZsXNmv8wTjhiYdBJVGVBNeIQJ8JLykpj2K5xY 6AIOdL9qnWkGvBesQXVzyx6JTJlcjx981WctlrYgth+O+xepb5hWmYy0lbvtHGMXa5T+ qJe7DwJfichKJ27gUqnU/dOkQpedkJCP8DMTWOUh9d0vNVaCHPq2086hXUC/YBol0DLs e0lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lG7poJpr; 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 t23-20020a056402241700b00445f3dd3861si1831657eda.313.2022.08.23.06.00.36; Tue, 23 Aug 2022 06:01:03 -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=lG7poJpr; 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 S1357526AbiHWLm1 (ORCPT + 99 others); Tue, 23 Aug 2022 07:42:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242125AbiHWLhU (ORCPT ); Tue, 23 Aug 2022 07:37:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FE94C992A; Tue, 23 Aug 2022 02:28:11 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 6225161330; Tue, 23 Aug 2022 09:28:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63E27C433D7; Tue, 23 Aug 2022 09:28:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246889; bh=mGkh9x3LB0kpL5XkmS7qHndStB4OsfpUDJQhVibN7SQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lG7poJproGqvf8ig+bF+WnCK8/0CDi9R/6ub81hc7/9mP8HXbblvUuCwUO8CejGSs 3QiutQ1UTMIe3zfTIQNIO2Jr0+ohk+6GDYoqYudxxyT4yPi9XxaOx5ljV5uuGl5DG7 q5GYq8nNl1QOiCFg4KLtF7sXkb/cmeL94oV+TP14= 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 5.4 252/389] x86/olpc: fix logical not is only applied to the left hand side Date: Tue, 23 Aug 2022 10:25:30 +0200 Message-Id: <20220823080126.119312764@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@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 @@ -81,7 +81,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);