Skip to content

Commit ef91bb1

Browse files
herbertxtorvalds
authored andcommitted
kernel.h: Silence sparse warning in lower_32_bits
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) [.. many more ..] This patch removes the warning by adding a mask to keep sparse happy. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e309428 commit ef91bb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/kernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
* lower_32_bits - return bits 0-31 of a number
187187
* @n: the number we're accessing
188188
*/
189-
#define lower_32_bits(n) ((u32)(n))
189+
#define lower_32_bits(n) ((u32)((n) & 0xffffffff))
190190

191191
struct completion;
192192
struct pt_regs;

0 commit comments

Comments
 (0)