summaryrefslogtreecommitdiff
path: root/include/linux/compiler-gcc.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-09-13 03:12:20 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-09-13 03:12:20 +0200
commitf75ee9a8816824683e22aee2790f43a9fc43c613 (patch)
tree8eb48525bcd0291668d56d0bc4e8a0467467b9b3 /include/linux/compiler-gcc.h
parentbd2058dc1aa88ac5690184f85a1e5051b12cd573 (diff)
parent20a875e2e86e73d13ec256781a7d55a7885868ec (diff)
Merge branch 'device-properties' into acpi-soc
Diffstat (limited to 'include/linux/compiler-gcc.h')
-rw-r--r--include/linux/compiler-gcc.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index e2949397c19b..8dbc8929a6a0 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -242,7 +242,11 @@
*/
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
-#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
+/*
+ * sparse (__CHECKER__) pretends to be gcc, but can't do constant
+ * folding in __builtin_bswap*() (yet), so don't set these for it.
+ */
+#if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) && !defined(__CHECKER__)
#if GCC_VERSION >= 40400
#define __HAVE_BUILTIN_BSWAP32__
#define __HAVE_BUILTIN_BSWAP64__
@@ -250,7 +254,7 @@
#if GCC_VERSION >= 40800
#define __HAVE_BUILTIN_BSWAP16__
#endif
-#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */
#if GCC_VERSION >= 50000
#define KASAN_ABI_VERSION 4