selftests/bpf/progs: use __auto_type in swap() macro
Subsystems (6)
PATCH 1/1 selftests/bpf/progs: use __auto_type in swap() macro
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.
--- tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c +1 -1
@@ -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)#define __get_unaligned_t (type, ptr) ({ \ const struct { type x; } __attribute__((__packed__)) *__pptr = (typeof(__pptr))(ptr); \
Signature · 1 line
2.49.0
Quoted 15 lines · Pranav Tyagi
Replace
typeof()with__auto_typeinxdp_synproxy_kern.c.__auto_typewas introduced in GCC 4.9 and reduces the compile time for all compilers. No functional changes intended.Signed-off-by Pranav Tyagi <[email protected]>--- tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c +0
-0
tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c line 61
Quoted 5 lines
tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c +1
-1@@ -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
Quoted 19 lines · Alexei Starovoitov
Quoted 17 lines · Pranav Tyagi
Replace
typeof()with__auto_typeinxdp_synproxy_kern.c.__auto_typewas introduced in GCC 4.9 and reduces the compile time for all compilers. No functional changes intended.Signed-off-by Pranav Tyagi <[email protected]>--- tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c +0
-0@@ -58,7 +58,7 @@#define MAX_PACKET_OFF 0xffff
Quoted 8 lines
tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c line 61
Quoted 3 lines
tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c +1
-1#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
I understand. Thanks