Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3396631rwa; Tue, 23 Aug 2022 04:12:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR7preBZyARp1QYpqH7O4y75haIvBi1c4gUQ4YXvLeKtcMFDgA9qgYhTMJC2RPfCfMP1Y+M1 X-Received: by 2002:a17:903:2049:b0:172:eb95:c61e with SMTP id q9-20020a170903204900b00172eb95c61emr8707685pla.74.1661253164855; Tue, 23 Aug 2022 04:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253164; cv=none; d=google.com; s=arc-20160816; b=q/ccJQpR4PrENxHwMC1oytQfPsRToR5nKlYIgC1WZSXNsRor/ytSero4o0Hwf0ZcMl N6jYDqDWTjqB//q72aZ+hbhwgz4SK86tRY2/jvIvYIBIaULEdyLI8vTai1Ymq3PHKLua VCwqG8+OfYq1xUFxQnZrrzJx76F1O80yNYr1IjwT20a9FVhQR27wYv+MCkHcoyb+btBd dvkT1RQLPRwHEO4pCUNCQFT5zJtAHvSFz7SWlB5lvyd9WC7SQC5UJy6m72XszZ2JTf4h 6pqr9ZDaxsBhePr34M/oWJih8dBa+fRoHqKhw2pV56CidBBtOVIvNuUKS7gG9QODYV9X nxfw== 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=twNQbZrakYAsj+ipUpjhjmHu5fQUO4N2eVS39T9baB2ZkxrLtqnhUnGndiD7UMvXeR fkqTRvD9WBDnwB3ILhp8e544s1fBykZuN/XhJ69ffWXEPDTt9cT5qTY7yHv9bMWBym5M ohfeTwk5hGYjLZxtEQnZMRWRfakvQnNGVZvgyqKwTL6hSTsUS7NfKTl+K4N+apAFJ+W3 hpucCwekinBj8xWyACgc14E9WDvO2vkoHqXtOeJL8juR2NBXdOyG8R3JJk30dBg0T12r w3RGP16+A2b9qk75XliwFYcKpKWQ/FK1G3q0BlHgkkmnB0PhAl05/YSq+MuqQDU78fTE afkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vRc2FLlt; 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 q18-20020a170902f79200b001726a59e2desi13770211pln.133.2022.08.23.04.12.33; Tue, 23 Aug 2022 04:12:44 -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=vRc2FLlt; 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 S1352450AbiHWKFo (ORCPT + 99 others); Tue, 23 Aug 2022 06:05:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352153AbiHWKBR (ORCPT ); Tue, 23 Aug 2022 06:01:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27C903C16F; Tue, 23 Aug 2022 01:48:47 -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 48B0DB81BF8; Tue, 23 Aug 2022 08:48:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7468AC433D6; Tue, 23 Aug 2022 08:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244525; bh=ttLvW3MfLOd5HkB/xUpnfI6bCZM/YFhvYh+VBRclgbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vRc2FLltCCjPKAOQdwG2g0yFCFLztXQWuZWrJWu6m+Y/sgnxrs6wqlRmVkO91tB49 Znhm8a/53UvYK8QKw2n/vAmM7CdM3bz2CPUM8xsW6WUpdhdKUuVRd7JQDQHZMG2jO6 ux3WwtGbbCs12+4oB2GL+JFJLAVa541A8wKwDLn4= 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.14 150/229] x86/olpc: fix logical not is only applied to the left hand side Date: Tue, 23 Aug 2022 10:25:11 +0200 Message-Id: <20220823080059.035353456@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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);