diff options
| author | Jakub Kicinski <[email protected]> | 2021-05-27 09:22:11 -0700 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2021-05-27 09:55:10 -0700 |
| commit | 5ada57a9a6b0be0e6dfcbd4afa519b0347fd5649 (patch) | |
| tree | f82f466df9272bb0c385320b25adc51c45309f84 /tools/include/linux | |
| parent | 59c56342459a483d5e563ed8b5fdb77ab7622a73 (diff) | |
| parent | d7c5303fbc8ac874ae3e597a5a0d3707dc0230b4 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
cdc-wdm: s/kill_urbs/poison_urbs/ to fix build
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/include/linux')
| -rw-r--r-- | tools/include/linux/bits.h | 2 | ||||
| -rw-r--r-- | tools/include/linux/const.h | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tools/include/linux/bits.h b/tools/include/linux/bits.h index 7f475d59a097..87d112650dfb 100644 --- a/tools/include/linux/bits.h +++ b/tools/include/linux/bits.h @@ -22,7 +22,7 @@ #include <linux/build_bug.h> #define GENMASK_INPUT_CHECK(h, l) \ (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \ - __builtin_constant_p((l) > (h)), (l) > (h), 0))) + __is_constexpr((l) > (h)), (l) > (h), 0))) #else /* * BUILD_BUG_ON_ZERO is not available in h files included from asm files, diff --git a/tools/include/linux/const.h b/tools/include/linux/const.h index 81b8aae5a855..435ddd72d2c4 100644 --- a/tools/include/linux/const.h +++ b/tools/include/linux/const.h @@ -3,4 +3,12 @@ #include <vdso/const.h> +/* + * This returns a constant expression while determining if an argument is + * a constant expression, most importantly without evaluating the argument. + * Glory to Martin Uecker <[email protected]> + */ +#define __is_constexpr(x) \ + (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8))) + #endif /* _LINUX_CONST_H */ |