Skip to contentSkip to conversation

selftests/bpf/progs: replace typeof() with __auto_type

PATCH New Pranav Tyagi 1 participant 1 message Aug 6, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/bpf/progs: replace typeof() with __auto_type

Replace typeof() with __auto_type in bpf_dctcp.c. __auto_type was introduced in GCC 4.9 and reduces the compile time for all compilers. No functional changes intended.

---
 tools/testing/selftests/bpf/progs/bpf_dctcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/progs/bpf_dctcp.c +2 -2
index 7cd73e75f52a..0bab6cec6bbc 100644
@@ -16,8 +16,8 @@
 #define min(a, b) ((a) < (b) ? (a) : (b))
 #define max(a, b) ((a) > (b) ? (a) : (b))
 #define min_not_zero(x, y) ({			\
-	typeof(x) __x = (x);			\
-	typeof(y) __y = (y);			\
+	__auto_type __x = (x);			\
+	__auto_type __y = (y);			\
 	__x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); })
 static bool before(__u32 seq1, __u32 seq2)
 {
Signature · 1 line
2.49.0