compiler_types.h: Use unoptimized __unqual_scalar_typeof for sparse
authorMarco Elver <elver@google.com>
Thu, 28 May 2020 07:43:13 +0000 (09:43 +0200)
committerWill Deacon <will@kernel.org>
Fri, 5 Jun 2020 10:40:01 +0000 (11:40 +0100)
If the file is being checked with sparse, use the unoptimized version of
__unqual_scalar_typeof(), since sparse does not support _Generic.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/202005280727.lXn1VnTw%lkp@intel.com
Signed-off-by: Will Deacon <will@kernel.org>
include/linux/compiler_types.h

index 31416b60eabff430fd37d2c9d1fe333ff056bcc7..cd73e3857a87922a1ae39a9dc79e50a2cd066a9c 100644 (file)
@@ -214,7 +214,7 @@ struct ftrace_likely_data {
  * __unqual_scalar_typeof(x) - Declare an unqualified scalar type, leaving
  *                            non-scalar types unchanged.
  */
-#if defined(CONFIG_CC_IS_GCC) && CONFIG_GCC_VERSION < 40900
+#if (defined(CONFIG_CC_IS_GCC) && CONFIG_GCC_VERSION < 40900) || defined(__CHECKER__)
 /*
  * We build this out of a couple of helper macros in a vain attempt to
  * help you keep your lunch down while reading it.