[tip: core/urgent] compiler.h: Avoid the usage of __typeof_unqual__() when __GENKSYMS__ is defined
From: tip-bot2 for Uros Bizjak
Date: Thu Apr 10 2025 - 06:59:02 EST
The following commit has been merged into the core/urgent branch of tip:
Commit-ID: e696e5a114b59035f5a889d5484fedec4f40c1f3
Gitweb: https://git.kernel.org/tip/e696e5a114b59035f5a889d5484fedec4f40c1f3
Author: Uros Bizjak <ubizjak@xxxxxxxxx>
AuthorDate: Fri, 04 Apr 2025 12:24:37 +02:00
Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx>
CommitterDate: Thu, 10 Apr 2025 12:44:27 +02:00
compiler.h: Avoid the usage of __typeof_unqual__() when __GENKSYMS__ is defined
Current version of genksyms doesn't know anything about __typeof_unqual__()
operator. Avoid the usage of __typeof_unqual__() with genksyms to prevent
errors when symbols are versioned.
There were no problems with gendwarfksyms.
Fixes: ac053946f5c40 ("compiler.h: introduce TYPEOF_UNQUAL() macro")
Closes: https://lore.kernel.org/lkml/81a25a60-de78-43fb-b56a-131151e1c035@xxxxxxxxxxxxx/
Reported-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>
Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>
Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Tested-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20250404102535.705090-1-ubizjak@xxxxxxxxx
---
include/linux/compiler.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 27725f1..98057f9 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -229,10 +229,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
/*
* Use __typeof_unqual__() when available.
*
- * XXX: Remove test for __CHECKER__ once
- * sparse learns about __typeof_unqual__().
+ * XXX: Remove test for __GENKSYMS__ once "genksyms" handles
+ * __typeof_unqual__(), and test for __CHECKER__ once "sparse" handles it.
*/
-#if CC_HAS_TYPEOF_UNQUAL && !defined(__CHECKER__)
+#if CC_HAS_TYPEOF_UNQUAL && !defined(__GENKSYMS__) && !defined(__CHECKER__)
# define USE_TYPEOF_UNQUAL 1
#endif