public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	bpf@vger.kernel.org, Martin KaFai Lau <kafai@fb.com>,
	Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>
Subject: Re: [PATCH bpf-next] selftests/bpf: Move ARRAY_SIZE to bpf_misc.h
Date: Tue, 25 Jun 2024 18:26:35 +0200	[thread overview]
Message-ID: <Znrvu4luJqftqWy8@krava> (raw)
In-Reply-To: <808ae131-447e-433d-bd01-f04898b87497@oracle.com>

On Tue, Jun 25, 2024 at 09:46:55AM +0100, Alan Maguire wrote:
> On 25/06/2024 06:27, Jiri Olsa wrote:
> > ARRAY_SIZE is used on multiple places, move its definition in
> > bpf_misc.h header.
> > 
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> 
> good idea ; one very optional nit/suggestion below but
> 
> Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
> 
> > ---
> >  tools/testing/selftests/bpf/progs/bpf_misc.h                 | 2 ++
> >  tools/testing/selftests/bpf/progs/iters.c                    | 2 --
> >  tools/testing/selftests/bpf/progs/kprobe_multi_session.c     | 3 +--
> >  tools/testing/selftests/bpf/progs/linked_list.c              | 5 +----
> >  tools/testing/selftests/bpf/progs/netif_receive_skb.c        | 5 +----
> >  tools/testing/selftests/bpf/progs/profiler.inc.h             | 5 +----
> >  tools/testing/selftests/bpf/progs/setget_sockopt.c           | 5 +----
> >  tools/testing/selftests/bpf/progs/test_bpf_ma.c              | 4 ----
> >  tools/testing/selftests/bpf/progs/test_sysctl_loop1.c        | 5 +----
> >  tools/testing/selftests/bpf/progs/test_sysctl_loop2.c        | 5 +----
> >  tools/testing/selftests/bpf/progs/test_sysctl_prog.c         | 5 +----
> >  .../testing/selftests/bpf/progs/test_tcp_custom_syncookie.c  | 1 +
> >  .../testing/selftests/bpf/progs/test_tcp_custom_syncookie.h  | 2 --
> >  .../testing/selftests/bpf/progs/verifier_subprog_precision.c | 2 --
> >  14 files changed, 11 insertions(+), 40 deletions(-)
> > 
> > diff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h
> > index c0280bd2f340..ac6ab1b977a1 100644
> > --- a/tools/testing/selftests/bpf/progs/bpf_misc.h
> > +++ b/tools/testing/selftests/bpf/progs/bpf_misc.h
> > @@ -140,4 +140,6 @@
> >  /* make it look to compiler like value is read and written */
> >  #define __sink(expr) asm volatile("" : "+g"(expr))
> >  
> > +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
> 
> nit: would it be worth bracketing the #define in an #ifndef
> ARRAY_SIZE/#endif? A few cases you're replacing (like
> progs/linked_list.c) have the #ifndef/#endif protection.

sure, makes sense, will send v2

thanks,
jirka

      reply	other threads:[~2024-06-25 16:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25  5:27 [PATCH bpf-next] selftests/bpf: Move ARRAY_SIZE to bpf_misc.h Jiri Olsa
2024-06-25  8:46 ` Alan Maguire
2024-06-25 16:26   ` Jiri Olsa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Znrvu4luJqftqWy8@krava \
    --to=olsajiri@gmail.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=sdf@google.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox