Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2310777pxb; Fri, 8 Oct 2021 05:26:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2ybywxKBm4OkZ8w0YBvMYyt71RjkTIVjqV3gWN0R+Vylq2GqSrTd+F8UbpwRoXlduyc8T X-Received: by 2002:a17:907:75e1:: with SMTP id jz1mr3972596ejc.439.1633695994661; Fri, 08 Oct 2021 05:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633695994; cv=none; d=google.com; s=arc-20160816; b=wVV+vjUhknoquCM8QccVeLp/hZ4ME8miXZFlvKZu8SIyfN3Nz1qY36VbDseHX8R7F0 dqTMopuzmv8GeCiQI51Y5L3BU0gzlDiHS8Oq6If7cazkCsVkdNgaguISNYgGeMDjwqxx rgCHlg/9TCxJbYcLLbgjn4uFQSfy4GR9bClB4ufZekdkUQo0dpXX8E9bJ35ltOEPGpbJ uk8bt8/TZL/64LOqAOAP9zCzzjR5iGMPrPAc99awBDqZGDEY6efRbAMJwW1yNtt6zjba UppDNMKgOzIfDAZN5WoEn0g468rqc25wGVJB1cq7lQO3jYCZhk5/M6bwL0z2uW7+n1ns QYpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=i8imkdMfueCIFe1l9kT7913wf22rmXqa/MA3cEgwfU4=; b=fOSRI/zXK1v6HVGdNnyt4JNENAVLA2T1caBnuw4+TK+1pwFxf7qlhLtNpWpgaPxWT+ lx6JVGQMo3n5k1+YIvDbYZ6tZQUHHplEq23VHga7+V3ZpIDupot/GpjzCsPggmYJIx4g 0mtHpO3lWHqt/aygcA+092MVcdUhdec3zGx9I9y9opCkVsENpI7GeQ0QNqLiGMp+3dlX BNObLmXruauMCibGA7AbiaNowe2uQSns8JdyOdKN20br00iYFE73rGAupIdgPWqsPd96 Qob9RJrs1zERwZnMMdPzYic/8/RU4OOqggFbXZwbs48PrFYLVPXK9cY4H2TRg6r4NDUr 2/+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si4009264edm.216.2021.10.08.05.26.10; Fri, 08 Oct 2021 05:26:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241079AbhJHMZu (ORCPT + 99 others); Fri, 8 Oct 2021 08:25:50 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:55914 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbhJHMZt (ORCPT ); Fri, 8 Oct 2021 08:25:49 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtp (Exim 4.92 #5 (Debian)) id 1mYouc-0003bC-UL; Fri, 08 Oct 2021 20:23:42 +0800 Received: from herbert by gondobar with local (Exim 4.92) (envelope-from ) id 1mYouW-00085i-Da; Fri, 08 Oct 2021 20:23:36 +0800 Date: Fri, 8 Oct 2021 20:23:36 +0800 From: Herbert Xu To: Arnd Bergmann Cc: Gilad Ben-Yossef , "David S. Miller" , Nathan Chancellor , Nick Desaulniers , Arnd Bergmann , YueHaibing , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] crypto: ccree - avoid out-of-range warnings from clang Message-ID: <20211008122336.GB31060@gondor.apana.org.au> References: <20210927121811.940899-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210927121811.940899-1-arnd@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Sep 27, 2021 at 02:18:03PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > clang points out inconsistencies in the FIELD_PREP() invocation in > this driver that result from the 'mask' being a 32-bit value: > > drivers/crypto/ccree/cc_driver.c:117:18: error: result of comparison of constant 18446744073709551615 with expression of type 'u32' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] > cache_params |= FIELD_PREP(mask, val); > ^~~~~~~~~~~~~~~~~~~~~ > include/linux/bitfield.h:94:3: note: expanded from macro 'FIELD_PREP' > __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/bitfield.h:52:28: note: expanded from macro '__BF_FIELD_CHECK' > BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, \ > ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > This does not happen in other places that just pass a constant here. > > Work around the warnings by widening the type of the temporary variable. > > Fixes: 05c2a705917b ("crypto: ccree - rework cache parameters handling") > Signed-off-by: Arnd Bergmann > --- > drivers/crypto/ccree/cc_driver.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt