From patchwork Mon Sep 27 12:18:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 514681 Delivered-To: patch@linaro.org Received: by 2002:a17:906:f46:0:0:0:0 with SMTP id h6csp3881056ejj; Mon, 27 Sep 2021 05:18:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxejwt5aXBdCC7kPMta2ZaC5iElkcptx6LTQQYB5Mjy58PEy28jQkAxpXGDtx6AJxxzkujI X-Received: by 2002:a17:90b:14d6:: with SMTP id jz22mr11532980pjb.61.1632745097851; Mon, 27 Sep 2021 05:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632745097; cv=none; d=google.com; s=arc-20160816; b=CJB/CsK7CKN90g0vyBWPoxLkg5KZ8BT9X36x6mW5e5Ri/mMZTN3iRFl7BNfcfTcPV0 yNFQkkWkLz0xmzsD7CVbmtQ5j/zoRDq8N8zUnrmsGJvfnbOMwFrUfLJuSMMPchIx4Wnu 9EqgnF418DW57hznSUlk0oaGrKwejNhLOHq62E3pS9e0Y99q8MB6KZSOOFxrXLjFRjUs yCWi3ALoLzJ4ICBqzMuQjMUe3C4DzVd0J/vX6oKWa48smZIlyUhx9tyWscYGmLAmF0PH IxfJlrD4RvtPhhvx8QXeyMMXcOTS8xkn5iZdWjXLwkCdhW7BhJ/+diuFWmYB/obxo3MY KpHw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=V5cre/YMv9RlF2DuSg/8HgmWu0/YmVIjosyDwV8JuRw=; b=QAWCIxz+e5a5nMd0ATRZl3XSMV8gL1WF0k0wwr7xqIIRUdo0Db978HQBFUXrn3ACI+ aCi9ZcCWEGVvP+0VaB3Stv+2BHwaPXMvutbaCJ8na+3XmLbeRx+14MRER0UruJ90i7aX ZNrmn2FGwuIZbJEIGhFFELM/077w996aUlfMY79NcT7FKAgE+VrctwNgTHMPB0oCGkDe /02n7vPylLwIFy2wXssJXLMGigX+amsPPC+0Z/gIF2PLTaiQVtb8U2hZ33qGQ0cc23PQ FPw+u+imlAtXFRJMofmJVnIisVEDW4P1ZF0i4yNgoy8bfmYa+IQfdhT2zi9CjDRulspQ j3iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FGWy3XGV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m22si12797611pgd.318.2021.09.27.05.18.17; Mon, 27 Sep 2021 05:18:17 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FGWy3XGV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234170AbhI0MTy (ORCPT + 3 others); Mon, 27 Sep 2021 08:19:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:43330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234162AbhI0MTw (ORCPT ); Mon, 27 Sep 2021 08:19:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 634DE6103B; Mon, 27 Sep 2021 12:18:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632745095; bh=Q51NkLhfdP9cqBSlpTRPX/qx56tDI5PJVgL+PG3DiO8=; h=From:To:Cc:Subject:Date:From; b=FGWy3XGVbDh9POAkE0jOMILMxXxn2dHjEaB65vSUN2ibK4GKnnLvO+jDJSa5Y8W5b z+bNFnP4ihkhgUT96JUBije9Jwg7bhNTAsjBQc3tnbJfAHe67NCQzgdNmfwOPgm0Zj uD9uG5dZ+s6sfdZHbknAVtUYf7g+tSCbbxs9gGat9oIJuqMnxe4lz43GYDTm5sZc0S v+L5qFU/E23Zg3XoskoNZgSXDojlrSoRTWnW9S2uOhqoKe5gt2HCosD5bh51KlVDnd flG7waqG00wNJpTPlF1ZIip6TxilRlR7N03SwIQVsx9Kt0MlY0pcUlb651Z1C5X8aS jjTsIv0YG+ZXw== From: Arnd Bergmann To: Gilad Ben-Yossef , Herbert Xu , "David S. Miller" , Nathan Chancellor , Nick Desaulniers Cc: Arnd Bergmann , YueHaibing , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] crypto: ccree - avoid out-of-range warnings from clang Date: Mon, 27 Sep 2021 14:18:03 +0200 Message-Id: <20210927121811.940899-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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(-) -- 2.29.2 Acked-by: Gilad ben-Yossef diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c index e599ac6dc162..790fa9058a36 100644 --- a/drivers/crypto/ccree/cc_driver.c +++ b/drivers/crypto/ccree/cc_driver.c @@ -103,7 +103,8 @@ MODULE_DEVICE_TABLE(of, arm_ccree_dev_of_match); static void init_cc_cache_params(struct cc_drvdata *drvdata) { struct device *dev = drvdata_to_dev(drvdata); - u32 cache_params, ace_const, val, mask; + u32 cache_params, ace_const, val; + u64 mask; /* compute CC_AXIM_CACHE_PARAMS */ cache_params = cc_ioread(drvdata, CC_REG(AXIM_CACHE_PARAMS));