mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 05:26:07 +00:00
linux/bits.h: simplify GENMASK_INPUT_CHECK()
In GENMASK_INPUT_CHECK(), __builtin_choose_expr(__is_constexpr((l) > (h)), (l) > (h), 0) is the exact expansion of: const_true((l) > (h)) Apply const_true() to simplify GENMASK_INPUT_CHECK(). CC: Linus Torvalds <torvalds@linux-foundation.org> CC: Rasmus Villemoes <linux@rasmusvillemoes.dk> CC: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Reviewed-by: Yury Norov <yury.norov@gmail.com>, Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by: Yury Norov <yury.norov@gmail.com>
This commit is contained in:
parent
c36b2644fb
commit
5771af94fa
@ -20,9 +20,8 @@
|
||||
*/
|
||||
#if !defined(__ASSEMBLY__)
|
||||
#include <linux/build_bug.h>
|
||||
#define GENMASK_INPUT_CHECK(h, l) \
|
||||
(BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
|
||||
__is_constexpr((l) > (h)), (l) > (h), 0)))
|
||||
#include <linux/compiler.h>
|
||||
#define GENMASK_INPUT_CHECK(h, l) BUILD_BUG_ON_ZERO(const_true((l) > (h)))
|
||||
#else
|
||||
/*
|
||||
* BUILD_BUG_ON_ZERO is not available in h files included from asm files,
|
||||
|
Loading…
x
Reference in New Issue
Block a user