History

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.

Herbert Xu committed 6 years ago

Commit ef91bb11 parent e3094281 file · +1 −1Browse files

Unified · Split

include/linux/kernel.h+1−1
@@ -186,7 +186,7 @@ · 185 unmodified lines
186 * lower_32_bits - return bits 0-31 of a number186 * lower_32_bits - return bits 0-31 of a number
187 * @n: the number we're accessing187 * @n: the number we're accessing
188 */188 */
189#define lower_32_bits(n) ((u32)(n))189#define lower_32_bits(n) ((u32)((n) & 0xffffffff))
190 190
191struct completion;191struct completion;
192struct pt_regs;192struct pt_regs;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t