Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

include/linux/compiler-gcc.h: sparse can do constant folding of __builtin_bswap*()

Sparse can do constant folding of __builtin_bswap*() since 2017. Also, a
much recent version of Sparse is needed anyway, see commit 6ec4476ac825
("Raise gcc version requirement to 4.9").

So, remove the comment about sparse not being yet able to constant fold
__builtin_bswap*() and remove the corresponding test of __CHECKER__.

Link: https://lkml.kernel.org/r/20210226092236.99369-1-luc.vanoostenryck@gmail.com
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Luc Van Oostenryck and committed by
Linus Torvalds
d991bb1c 99e729bd

+2 -6
+2 -6
include/linux/compiler-gcc.h
··· 90 90 */ 91 91 #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) 92 92 93 - /* 94 - * sparse (__CHECKER__) pretends to be gcc, but can't do constant 95 - * folding in __builtin_bswap*() (yet), so don't set these for it. 96 - */ 97 - #if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) && !defined(__CHECKER__) 93 + #if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) 98 94 #define __HAVE_BUILTIN_BSWAP32__ 99 95 #define __HAVE_BUILTIN_BSWAP64__ 100 96 #define __HAVE_BUILTIN_BSWAP16__ 101 - #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */ 97 + #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ 102 98 103 99 #if GCC_VERSION >= 70000 104 100 #define KASAN_ABI_VERSION 5