compilerh-introduce-typeof_unqual-macro.patch removed from -mm tree
The quilt patch titled
Subject: compiler.h: introduce TYPEOF_UNQUAL() macro
has been removed from the -mm tree. Its filename was
compilerh-introduce-typeof_unqual-macro.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Uros Bizjak <[email protected]>
Subject: compiler.h: introduce TYPEOF_UNQUAL() macro
Date: Mon, 27 Jan 2025 17:05:06 +0100
Define TYPEOF_UNQUAL() to use __typeof_unqual__() as typeof operator when available, to return unqualified type of the expression.
Current version of sparse doesn't know anything about __typeof_unqual__() operator. Avoid the usage of __typeof_unqual__() when sparse checking is active to prevent sparse errors with unknowing keyword.
---
include/linux/compiler-clang.h | 8 ++++++++ include/linux/compiler-gcc.h | 8 ++++++++ include/linux/compiler.h | 20 ++++++++++++++++++++ 3 files changed, 36 insertions(+)
include/linux/compiler-clang.h renamed from include/linux/compiler-clang.h~compilerh-introduce-typeof_unqual-macro +8 -0
@@ -128,3 +128,11 @@*/ #define ASM_INPUT_G "ir"#define ASM_INPUT_RM "r" + +/* +* Declare compiler support for __typeof_unqual__() operator. +* +* Bindgen uses LLVM even if our C compiler is GCC, so we cannot +* rely on the auto-detected CONFIG_CC_HAS_TYPEOF_UNQUAL. +*/ +#define CC_HAS_TYPEOF_UNQUAL (__clang_major__ >= 19)
include/linux/compiler-gcc.h renamed from include/linux/compiler-gcc.h~compilerh-introduce-typeof_unqual-macro +8 -0
@@ -137,3 +137,11 @@#if GCC_VERSION <90100 #undef __alloc_size__#endif + +/* +* Declare compiler support for __typeof_unqual__() operator. +* +* Bindgen uses LLVM even if our C compiler is GCC, so we cannot +* rely on the auto-detected CONFIG_CC_HAS_TYPEOF_UNQUAL. +*/ +#define CC_HAS_TYPEOF_UNQUAL (__GNUC__ >= 14)
include/linux/compiler.h renamed from include/linux/compiler.h~compilerh-introduce-typeof_unqual-macro +20 -0
@@ -210,6 +210,26 @@ void ftrace_likely_update(struct ftrace_#define __must_be_cstr (p) \ __BUILD_BUG_ON_ZERO_MSG(__annotated(p, nonstring), "must be cstr (NUL-terminated)") +/* +* Use __typeof_unqual__() when available. +* +* XXX: Remove test for __CHECKER__ once +* sparse learns about __typeof_unqual__(). +*/ +#if CC_HAS_TYPEOF_UNQUAL && !defined(__CHECKER__) +# define USE_TYPEOF_UNQUAL 1 +#endif + +/* +* Define TYPEOF_UNQUAL() to use __typeof_unqual__() as typeof +* operator when available, to return an unqualified type of the exp. +*/ +#if defined(USE_TYPEOF_UNQUAL ) +# define TYPEOF_UNQUAL (exp) __typeof_unqual__(exp) +#else +# define TYPEOF_UNQUAL (exp) __typeof__(exp) +#endif +#endif /* __KERNEL__ */ /**
_
Patches currently in -mm which might be from [email protected] are