Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1864454rwb; Fri, 19 Aug 2022 10:39:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR4p7gwzftf01slI9hC137AAJmDIbNi6KLJnklWBKeAOuRhQ5+0pUnQVioIrxHjH7dAjoIVh X-Received: by 2002:a05:6a00:1a88:b0:52f:52df:ce1d with SMTP id e8-20020a056a001a8800b0052f52dfce1dmr8949698pfv.13.1660930768490; Fri, 19 Aug 2022 10:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930768; cv=none; d=google.com; s=arc-20160816; b=WQAdO7wmJAX+tjdz93Tsif+w8ApyI1icFzXZF86AZa8yPfy9H0xnAZmDZJJc3mZ5Zb ejnyqflrL5ozjuI2cEK0oJ9Y0cT4r8xKFO5zk8XTIq2RvGqYspA3pJ+ORx0RWZccitWo 5uBihcGZ2nS6YZJO4MwtWysR0vExk+iiFOJUe01G3NJ9GLaxigWDCF3FBpPPxSsbgv74 6BkqL+LERjTffCmrFrdTeP+nGVNuY/J8rP4ncIH00WSfK/lSQIh05Pj4f2TIA4Qf4Bez 0d5IOJrwW28MfFfmrxsi1TTj8yimVhMRESBT0uPZDPYAqUbq3//xmQrk3FhogYH6l1uj 4JIA== 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=T0l0KdXXpx9JXMx1yVH84XFUN3C104OfiJPCD8g+I/A=; b=rV/x3b62JPjbBfF7XsVZo6/hqgZw/xHsVSTeqY0ah3lZrH3huIjzgsGJ9Qud9OHQm4 D3Uhxh6ql8pDFGgec4yBg/mRJlK9luy682k8P1OTj54ynQaWiDsUtX4gUuChTSCNnv6Z 67lsMiElg8ndF8P56JMb16Wd9/AWWM3S9V3MvxpPxOTeyStZ2FL9JBpYPQlGAR12XZaj e0ZAHA3z8Exh+MofpdnJnUR5tsv3gTclbLP6tp5+0ZinIxRTWv8ZHj7zTOjM/qtw5tA5 5NtL5ejDJYHBhhe3iYf7875Mev+bPPXI4WgddVUua27V8s+U9dAFWyaf+oxTA7ZjsMjB V8Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Jqm+hTQu; 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 v21-20020a170902ca9500b0016ccf06c2aesi3949716pld.512.2022.08.19.10.39.17; Fri, 19 Aug 2022 10:39:28 -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=Jqm+hTQu; 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 S1355062AbiHSQ4v (ORCPT + 99 others); Fri, 19 Aug 2022 12:56:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354290AbiHSQy5 (ORCPT ); Fri, 19 Aug 2022 12:54:57 -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 9E278754A4; Fri, 19 Aug 2022 09:15:51 -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 A6026B82828; Fri, 19 Aug 2022 16:09:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF941C433C1; Fri, 19 Aug 2022 16:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925390; bh=StjgcR6nA87Jhlh+ZwYMvS8/tCMtuZEn7F+G7iUqQg8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jqm+hTQuS3YJzyh92NBUGxuSXUXIf7mo/MXVphNx9YIJAgxxKs7R9ZSO5Gob1MeK4 91XbY0jSdmz1wpVuh1G6AbQveAJq+KgHD9c244dWK54K2hsfo7qybBm9Mb6I+bwdig OYC0cV/s3rtGfgkEj9/n00SdVRf8Y9ATYKIudX6k= 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.10 447/545] x86/olpc: fix logical not is only applied to the left hand side Date: Fri, 19 Aug 2022 17:43:37 +0200 Message-Id: <20220819153849.436542896@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 @@ -80,7 +80,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);