Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp996932pxa; Fri, 28 Aug 2020 00:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKkC0FNkfQCLwWfmRISuPgpS30zW3GmBifSh906gD0NFENtgpDmLjTB8z+nZucuqeF0ABH X-Received: by 2002:a17:906:a45:: with SMTP id x5mr405545ejf.146.1598598840914; Fri, 28 Aug 2020 00:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598598840; cv=none; d=google.com; s=arc-20160816; b=i6MApRqTVUg3tQ3DllK9magI4pIDJZb8tQ70XyZ1nYrqlCgzY5BhxIMkbHPxgbpvo5 jvopjTK+yTRWocBLd5kHWEjvOktVeQhqamRy6H1VjhIk5I+zguhTzJcJRsXXq0FR7ptK u9DyKiz2pPzTpAM+1CaWBU4iSMQnZbHnHOBgfhTBS0qfbOfEn0Qrk3NHhp6SRSClptYZ xNoIGZ21tSCKMCBZV9LNt6tmJSPPKmpR8MvVMooGBQ21zXctA75NNrEKpfRxZvpcva9O 9yApJF00yr8XIMAFRiGAtZmgglNqdXrPhF/ZbvHmFzx/KMjFbaMTttmc1sOcFmzheex3 MrHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date; bh=PUWLh36VNaE2qHxEpxK7zXPWsjL+HqjWtns2reycFUc=; b=IK/OTCRxhWfFrStjEx3CjcRq6TUdF4tCzdNuSWn78RnSG+QYv/P6afVXG+IvPyLyco 6PwrdnIMv7zy0e7qnjeQqvoK0UHadyws5DbEzCds6GXDZpXS8GpQ7zbApNWww/9HqtE+ n0NSbqPU8nGWWaWdOC+hDDjudvJXDIT3pjElUMCPqKAMO1ULhxon+rLFOH0xqPUWJdmd u1ZpiMqCJIXCQt8m6NwxkECxZ+s8W6Cf4zpB/B9UBWSVHARdJPe5pPNKPXBlk29CK8T/ EsxzlMO4XYr00r6MorzTlKH9IdgTuXsPYT659YjuW0WzGKm+oqIdCoSjjbHZJc02Eeaw 2TpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 bd22si21324edb.339.2020.08.28.00.13.37; Fri, 28 Aug 2020 00:14:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728155AbgH1HLa (ORCPT + 99 others); Fri, 28 Aug 2020 03:11:30 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:35262 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbgH1HLa (ORCPT ); Fri, 28 Aug 2020 03:11:30 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1kBYXl-0003Zo-HP; Fri, 28 Aug 2020 17:11:26 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 28 Aug 2020 17:11:25 +1000 Date: Fri, 28 Aug 2020 17:11:25 +1000 From: Herbert Xu To: Andrew Morton , Linus Torvalds , Linux Kernel Mailing List , Joerg Roedel , Luc Van Oostenryck Subject: [PATCH] kernel.h: Silence sparse warning in lower_32_bits Message-ID: <20200828071125.GA18772@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I keep getting sparse warnings in crypto such as: CHECK ../drivers/crypto/ccree/cc_hash.c ../drivers/crypto/ccree/cc_hash.c:49:9: warning: cast truncates bits from constant value (47b5481dbefa4fa4 becomes befa4fa4) ../drivers/crypto/ccree/cc_hash.c:49:26: warning: cast truncates bits from constant value (db0c2e0d64f98fa7 becomes 64f98fa7) ../drivers/crypto/ccree/cc_hash.c:49:43: warning: cast truncates bits from constant value (8eb44a8768581511 becomes 68581511) ../drivers/crypto/ccree/cc_hash.c:49:60: warning: cast truncates bits from constant value (67332667ffc00b31 becomes ffc00b31) ../drivers/crypto/ccree/cc_hash.c:50:9: warning: cast truncates bits from constant value (152fecd8f70e5939 becomes f70e5939) ../drivers/crypto/ccree/cc_hash.c:50:26: warning: cast truncates bits from constant value (9159015a3070dd17 becomes 3070dd17) ../drivers/crypto/ccree/cc_hash.c:50:43: warning: cast truncates bits from constant value (629a292a367cd507 becomes 367cd507) ../drivers/crypto/ccree/cc_hash.c:50:60: warning: cast truncates bits from constant value (cbbb9d5dc1059ed8 becomes c1059ed8) ../drivers/crypto/ccree/cc_hash.c:52:9: warning: cast truncates bits from constant value (5be0cd19137e2179 becomes 137e2179) ../drivers/crypto/ccree/cc_hash.c:52:26: warning: cast truncates bits from constant value (1f83d9abfb41bd6b becomes fb41bd6b) ../drivers/crypto/ccree/cc_hash.c:52:43: warning: cast truncates bits from constant value (9b05688c2b3e6c1f becomes 2b3e6c1f) ../drivers/crypto/ccree/cc_hash.c:52:60: warning: cast truncates bits from constant value (510e527fade682d1 becomes ade682d1) ../drivers/crypto/ccree/cc_hash.c:53:9: warning: cast truncates bits from constant value (a54ff53a5f1d36f1 becomes 5f1d36f1) ../drivers/crypto/ccree/cc_hash.c:53:26: warning: cast truncates bits from constant value (3c6ef372fe94f82b becomes fe94f82b) ../drivers/crypto/ccree/cc_hash.c:53:43: warning: cast truncates bits from constant value (bb67ae8584caa73b becomes 84caa73b) ../drivers/crypto/ccree/cc_hash.c:53:60: warning: cast truncates bits from constant value (6a09e667f3bcc908 becomes f3bcc908) This patch removes the warning by adding a mask to keep sparse happy. Signed-off-by: Herbert Xu diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 500def620d8f..c25b8e41c0ea 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -186,7 +186,7 @@ * lower_32_bits - return bits 0-31 of a number * @n: the number we're accessing */ -#define lower_32_bits(n) ((u32)(n)) +#define lower_32_bits(n) ((u32)((n) & 0xffffffff)) struct completion; struct pt_regs; -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt