* [PATCH] selftests/bpf/progs: use __auto_type in swap() macro
@ 2025-08-06 11:02 Pranav Tyagi
2025-08-06 15:03 ` Alexei Starovoitov
0 siblings, 1 reply; 3+ messages in thread
From: Pranav Tyagi @ 2025-08-06 11:02 UTC (permalink / raw)
To: ast, daniel, davem, kuba, hawk, john.fastabend, andrii, eddyz87,
shuah
Cc: sdf, mykolal, martin.lau, song, yonghong.song, kpsingh, haoluo,
jolsa, netdev, bpf, linux-kselftest, linux-kernel,
linux-kernel-mentees, Pranav Tyagi
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 <pranav.tyagi03@gmail.com>
---
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)
#define __get_unaligned_t(type, ptr) ({ \
const struct { type x; } __attribute__((__packed__)) *__pptr = (typeof(__pptr))(ptr); \
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/bpf/progs: use __auto_type in swap() macro
2025-08-06 11:02 [PATCH] selftests/bpf/progs: use __auto_type in swap() macro Pranav Tyagi
@ 2025-08-06 15:03 ` Alexei Starovoitov
2025-08-06 15:25 ` Pranav Tyagi
0 siblings, 1 reply; 3+ messages in thread
From: Alexei Starovoitov @ 2025-08-06 15:03 UTC (permalink / raw)
To: Pranav Tyagi
Cc: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend,
Andrii Nakryiko, Eduard, Shuah Khan, Stanislav Fomichev,
Mykola Lysenko, Martin KaFai Lau, Song Liu, Yonghong Song,
KP Singh, Hao Luo, Jiri Olsa, Network Development, bpf,
open list:KERNEL SELFTEST FRAMEWORK, LKML, linux-kernel-mentees
On Wed, Aug 6, 2025 at 4:02 AM Pranav Tyagi <pranav.tyagi03@gmail.com> wrote:
>
> 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 <pranav.tyagi03@gmail.com>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/bpf/progs: use __auto_type in swap() macro
2025-08-06 15:03 ` Alexei Starovoitov
@ 2025-08-06 15:25 ` Pranav Tyagi
0 siblings, 0 replies; 3+ messages in thread
From: Pranav Tyagi @ 2025-08-06 15:25 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend,
Andrii Nakryiko, Eduard, Shuah Khan, Stanislav Fomichev,
Mykola Lysenko, Martin KaFai Lau, Song Liu, Yonghong Song,
KP Singh, Hao Luo, Jiri Olsa, Network Development, bpf,
open list:KERNEL SELFTEST FRAMEWORK, LKML, linux-kernel-mentees
On Wed, Aug 6, 2025 at 8:33 PM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Wed, Aug 6, 2025 at 4:02 AM Pranav Tyagi <pranav.tyagi03@gmail.com> wrote:
> >
> > 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 <pranav.tyagi03@gmail.com>
> > ---
> > 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
I understand. Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-06 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 11:02 [PATCH] selftests/bpf/progs: use __auto_type in swap() macro Pranav Tyagi
2025-08-06 15:03 ` Alexei Starovoitov
2025-08-06 15:25 ` Pranav Tyagi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).