Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2471152rwd; Wed, 14 Jun 2023 03:23:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5pCTANBTBCngi8rJGUyDwpszW5zzFu9ZPtgFIxvC3rsfJxOXhlvRx7vmBJVnOsViLRItUQ X-Received: by 2002:a05:6a21:980d:b0:118:b72c:2924 with SMTP id ue13-20020a056a21980d00b00118b72c2924mr663586pzb.60.1686738207787; Wed, 14 Jun 2023 03:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686738207; cv=none; d=google.com; s=arc-20160816; b=Hc36V/0yIIjMc+gPgbkEFlcrj8RALKw3rbWzrW5ThTUR688Qu/G5geIqSuG+slV0ye VMuGosbivgLiZYVS4C0Ep3DdyPs+vNf7vtKVSABvz79amGektI939iUUHQU8glj8oux1 u11MS9vvT368GOdqKwlzlhCOCIlvPDcRE8YdG+vm20ncMKbDdR6rRyA30ZBUE880Zqti m/YPKBHtnDnF3afThxO6d/ysteiCTAal/z7wFVPeGPGw/DGbTNgxVRfozZuZsxBePD9A y8U53IK9btYZNsYLruWRi/HC1jBfF5fq6ng6dMpY/HFoK00+tWTid+RMAFdwTylFVRZ+ XrlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=cMNFpfB4XIpWBV1h6hyubX3H48kr5qX3c+NDTaPtdB0=; b=cSuMqekvUJzlTjDu9RZAMXnB9SEsSWfREakuUD0qi89b3jKMqtTl8E7WWYdezHTzEz kBSBV4jHMz3FxN90nivw7lUNswASXn0yMaAGrPWr3MTxF9N40spCvrA/X7KreBZXY0DZ FgiI2Xkjs+3ZvYFKZvgwfXPt0HrZFXIJaq/H+nBfDv+vqR2C9+RwnMvSyY/+pyDoADdF 9nBxPAPOWr82mPVloqzYGdFqyN9oaWWYmF1woKq2kl1XjE9ymnH0j+wNq8G8cS7iHm+f AY+j2qUWDSA99QcydlY9SkybXW/ET5nrytT5W4VOD8W9rmLrwy6pS0N8azaJD2epxbxX 0a6w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lc7-20020a170902fa8700b001ab012a1ba9si2689042plb.402.2023.06.14.03.23.15; Wed, 14 Jun 2023 03:23:27 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230301AbjFNKRT convert rfc822-to-8bit (ORCPT + 99 others); Wed, 14 Jun 2023 06:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231408AbjFNKRR (ORCPT ); Wed, 14 Jun 2023 06:17:17 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E05E57 for ; Wed, 14 Jun 2023 03:17:16 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-108-hCXQcDGBNYyzCsxMMZVW0g-1; Wed, 14 Jun 2023 11:17:13 +0100 X-MC-Unique: hCXQcDGBNYyzCsxMMZVW0g-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 14 Jun 2023 11:17:10 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Wed, 14 Jun 2023 11:17:10 +0100 From: David Laight To: "'GONG, Ruiqi'" , Geert Uytterhoeven CC: Michael Turquette , Stephen Boyd , "linux-renesas-soc@vger.kernel.org" , "linux-clk@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "gongruiqi1@huawei.com" Subject: RE: [PATCH] clk: renesas: r8a7778: remove checker warnings: x | !y Thread-Topic: [PATCH] clk: renesas: r8a7778: remove checker warnings: x | !y Thread-Index: AQHZnaHR7xBIFyeGDEu0eJYf3JlEQa+KFZ7w Date: Wed, 14 Jun 2023 10:17:10 +0000 Message-ID: References: <20230613025403.3338129-1-gongruiqi@huaweicloud.com> In-Reply-To: <20230613025403.3338129-1-gongruiqi@huaweicloud.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: GONG, Ruiqi > Sent: 13 June 2023 03:54 > > Eliminate the following Sparse reports when building with C=1: > > drivers/clk/renesas/clk-r8a7778.c:85:52: warning: dubious: x | !y > drivers/clk/renesas/clk-r8a7778.c:87:50: warning: dubious: x | !y > > Signed-off-by: GONG, Ruiqi > --- > drivers/clk/renesas/clk-r8a7778.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/clk/renesas/clk-r8a7778.c b/drivers/clk/renesas/clk-r8a7778.c > index 797556259370..ad1a50f3b0cd 100644 > --- a/drivers/clk/renesas/clk-r8a7778.c > +++ b/drivers/clk/renesas/clk-r8a7778.c > @@ -81,11 +81,11 @@ static void __init r8a7778_cpg_clocks_init(struct device_node *np) > > BUG_ON(!(mode & BIT(19))); > > - cpg_mode_rates = (!!(mode & BIT(18)) << 2) | > - (!!(mode & BIT(12)) << 1) | > - (!!(mode & BIT(11))); Try just adding a << 0 on the last line. Recent gcc and clang optimise the code to 'shift + and'. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)