Thread (3 messages) 3 messages, 2 authors, 2025-08-06

Re: [PATCH] selftests/bpf/progs: use __auto_type in swap() macro

From: Alexei Starovoitov <hidden>
Date: 2025-08-06 15:03:52
Also in: bpf, linux-kernel-mentees, linux-kselftest, lkml

On Wed, Aug 6, 2025 at 4:02 AM Pranav Tyagi [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Replace typeof() with __auto_type in xdp_synproxy_kern.c.
__auto_type was introduced in GCC 4.9 and reduces the compile time for
all compilers. No functional changes intended.

Signed-off-by: Pranav Tyagi <redacted>
---
 tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c b/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c
index 62b8e29ced9f..b08738f9a0e6 100644
--- a/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c
+++ b/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c
@@ -58,7 +58,7 @@
 #define MAX_PACKET_OFF 0xffff

 #define swap(a, b) \
-       do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
+       do { __auto_type __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
Sorry, not doing this churn. The code is fine as-is.

--
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help