]> git.baikalelectronics.ru Git - kernel.git/commit
bitfield.h: Fix "type of reg too small for mask" test
authorPeter Zijlstra <peterz@infradead.org>
Wed, 10 Nov 2021 10:01:03 +0000 (11:01 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Sat, 11 Dec 2021 08:09:45 +0000 (09:09 +0100)
commitf57d58311e4a7f43fc4fa5d32f1f6d19e037c3f4
tree15b9247051bbfac2551bcbace278c62106474395
parent436159b63b3d21427b1a252607ce699e90c77c48
bitfield.h: Fix "type of reg too small for mask" test

The test: 'mask > (typeof(_reg))~0ull' only works correctly when both
sides are unsigned, consider:

 - 0xff000000 vs (int)~0ull
 - 0x000000ff vs (int)~0ull

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20211110101324.950210584@infradead.org
include/linux/bitfield.h