linux/tools/include/linux
Rikard Falkeborn f747e6667e linux/bits.h: fix compilation error with GENMASK
GENMASK() has an input check which uses __builtin_choose_expr() to
enable a compile time sanity check of its inputs if they are known at
compile time.

However, it turns out that __builtin_constant_p() does not always return
a compile time constant [0].  It was thought this problem was fixed with
gcc 4.9 [1], but apparently this is not the case [2].

Switch to use __is_constexpr() instead which always returns a compile time
constant, regardless of its inputs.

Link: https://lore.kernel.org/lkml/42b4342b-aefc-a16a-0d43-9f9c0d63ba7a@rasmusvillemoes.dk [0]
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19449 [1]
Link: https://lore.kernel.org/lkml/1ac7bbc2-45d9-26ed-0b33-bf382b8d858b@I-love.SAKURA.ne.jp [2]
Link: https://lkml.kernel.org/r/20210511203716.117010-1-rikard.falkeborn@gmail.com
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Yury Norov <yury.norov@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-22 15:09:07 -10:00
..
sched
unaligned
atomic.h
bitmap.h tools: sync small_const_nbits() macro with the kernel 2021-05-06 19:24:12 -07:00
bitops.h
bits.h linux/bits.h: fix compilation error with GENMASK 2021-05-22 15:09:07 -10:00
btf_ids.h
bug.h
build_bug.h
compiler-gcc.h
compiler.h
compiler_types.h
const.h linux/bits.h: fix compilation error with GENMASK 2021-05-22 15:09:07 -10:00
coresight-pmu.h tools headers UAPI: Update tools' copy of linux/coresight-pmu.h 2021-03-06 16:54:30 -03:00
ctype.h
debug_locks.h
delay.h
err.h
export.h
filter.h
ftrace.h
gfp.h
hardirq.h
hash.h
hashtable.h
interrupt.h
irqflags.h
jhash.h
kallsyms.h
kconfig.h x86/insn: Add an insn_decode() API 2021-03-15 11:05:47 +01:00
kern_levels.h
kernel.h
linkage.h
list.h
lockdep.h
log2.h
math64.h tools include: Add an initial math64.h 2021-04-15 16:38:02 -03:00
module.h
mutex.h
nmi.h
numa.h
objtool.h
overflow.h
poison.h
proc_fs.h
rbtree.h
rbtree_augmented.h
rcu.h
refcount.h
ring_buffer.h
seq_file.h
sizes.h
spinlock.h
stacktrace.h
static_call_types.h static_call: Move struct static_call_key definition to static_call_types.h 2021-03-11 16:04:39 +01:00
string.h
stringify.h
time64.h
types.h tools include: Add __sum16 and __wsum definitions. 2021-03-08 10:42:03 -03:00
zalloc.h