Skip to contentSkip to conversation

compiler_types: Remove unnecessary indirection in compiletime_assert()

PATCH New Tal Zussman 1 participant 1 message Jun 7, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 compiler_types: Remove unnecessary indirection in compiletime_assert()

compiletime_assert() is the only user of _compiletime_assert(), which uses __compiletime_assert() directly with no modification to arguments. Remove _compiletime_assert() and use __compiletime_assert() directly.

---
 include/linux/compiler_types.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
include/linux/compiler_types.h +1 -4
index 2b77d12e07b2..60d4fc8a89e5 100644
@@ -552,9 +552,6 @@ struct ftrace_likely_data {
 # define __compiletime_assert(condition, msg, prefix, suffix) ((void)(condition))
 #endif
 
-#define _compiletime_assert(condition, msg, prefix, suffix) \
-	__compiletime_assert(condition, msg, prefix, suffix)
-
 /**
  * compiletime_assert - break build and emit msg if condition is false
  * @condition: a compile-time constant condition to check
@@ -565,7 +562,7 @@ struct ftrace_likely_data {
  * compiler has support to do so.
  */
 #define compiletime_assert(condition, msg) \
-	_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
+	__compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
 
 #define compiletime_assert_atomic_type(t)				\
 	compiletime_assert(__native_word(t),				\

---
base-commit: bdc7f8c5adad50dad2ec762e317f8b212f5782ac
change-id: 20250607-compiletime_assert-13dc76f26a92

Best regards,

Signature · 1 line
Tal Zussman <[email protected]>