diff options
| author | Dan Williams <dan.j.williams@intel.com> | 2021-06-09 03:16:11 +0300 |
|---|---|---|
| committer | Dan Williams <dan.j.williams@intel.com> | 2021-06-09 03:16:11 +0300 |
| commit | 54ada34b4dfdb864ac602e13ff87581abe517ce9 (patch) | |
| tree | 8c92ca68c13e86b71f9cbf05a1a432c3ba4ea67b /tools/include/linux | |
| parent | 605a5e41db7d8c930fb80115686991c4c1d08ee4 (diff) | |
| parent | 4a2c1dcfaf59be4b357400d893c3f5daff6cab6c (diff) | |
| download | linux-54ada34b4dfdb864ac602e13ff87581abe517ce9.tar.xz | |
Merge branch 'rafael/acpica/cfmws' into for-5.14/cxl
Pick up the definition of the CXL Fixed Memory Window Structure from
Rafael's ACPICA development branch.
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 <Martin.Uecker@med.uni-goettingen.de> + */ +#define __is_constexpr(x) \ + (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8))) + #endif /* _LINUX_CONST_H */ |
