public inbox for linux-kselftest@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: "Guo Zhengkui" <guozhengkui@vivo.com>,
	"Shuah Khan" <shuah@kernel.org>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Andrii Nakryiko" <andrii@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@kernel.org>,
	"Yucong Sun" <sunyucong@gmail.com>,
	"Dave Marchevsky" <davemarchevsky@fb.com>,
	"Christy Lee" <christylee@fb.com>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Delyan Kratunov" <delyank@fb.com>,
	"open list:KERNEL SELFTEST FRAMEWORK"
	<linux-kselftest@vger.kernel.org>,
	"open list:BPF (Safe dynamic programs and tools)"
	<netdev@vger.kernel.org>,
	"open list:BPF (Safe dynamic programs and tools)"
	<bpf@vger.kernel.org>, "open list" <linux-kernel@vger.kernel.org>
Cc: zhengkui_guo@outlook.com
Subject: Re: [PATCH v2] selftests/bpf: fix array_size.cocci warning
Date: Thu, 10 Mar 2022 23:08:40 +0100	[thread overview]
Message-ID: <ba71e22a-cf59-b2bd-50c0-d0c9fb3f4e08@iogearbox.net> (raw)
In-Reply-To: <20220309033518.1743-1-guozhengkui@vivo.com>

On 3/9/22 4:35 AM, Guo Zhengkui wrote:
> Fix the array_size.cocci warning in tools/testing/selftests/bpf/
> 
> Use `ARRAY_SIZE(arr)` in bpf_util.h instead of forms like
> `sizeof(arr)/sizeof(arr[0])`.
> 
> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>

BPF CI fails with:

https://github.com/kernel-patches/bpf/runs/5498238267?check_suite_focus=true

   pahole: Multithreading requires elfutils >= 0.178. Continuing with a single thread...
   In file included from progs/test_rdonly_maps.c:7:
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:130:8: error: redefinition of 'bpf_map_def'
   struct bpf_map_def {
          ^
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:685:8: note: previous definition is here
   struct bpf_map_def {
          ^
   In file included from progs/test_rdonly_maps.c:7:
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:138:6: error: redefinition of 'libbpf_pin_type'
   enum libbpf_pin_type {
        ^
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:191:6: note: previous definition is here
   enum libbpf_pin_type {
        ^
   In file included from progs/test_rdonly_maps.c:7:
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:139:2: error: redefinition of enumerator 'LIBBPF_PIN_NONE'
           LIBBPF_PIN_NONE,
           ^
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:192:2: note: previous definition is here
           LIBBPF_PIN_NONE,
           ^
   In file included from progs/test_rdonly_maps.c:7:
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:141:2: error: redefinition of enumerator 'LIBBPF_PIN_BY_NAME'
           LIBBPF_PIN_BY_NAME,
           ^
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:194:2: note: previous definition is here
           LIBBPF_PIN_BY_NAME,
           ^
   In file included from progs/test_rdonly_maps.c:7:
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:144:6: error: redefinition of 'libbpf_tristate'
   enum libbpf_tristate {
        ^
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:1304:6: note: previous definition is here
   enum libbpf_tristate {
        ^
   In file included from progs/test_rdonly_maps.c:7:
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:145:2: error: redefinition of enumerator 'TRI_NO'
           TRI_NO = 0,
           ^
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:1305:2: note: previous definition is here
           TRI_NO = 0,
           ^
   In file included from progs/test_rdonly_maps.c:7:
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:146:2: error: redefinition of enumerator 'TRI_YES'
           TRI_YES = 1,
           ^
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:1306:2: note: previous definition is here
           TRI_YES = 1,
           ^
   In file included from progs/test_rdonly_maps.c:7:
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:147:2: error: redefinition of enumerator 'TRI_MODULE'
           TRI_MODULE = 2,
           ^
   /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:1307:2: note: previous definition is here
           TRI_MODULE = 2,
           ^
   8 errors generated.
   make: *** [Makefile:488: /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/test_rdonly_maps.o] Error 1
   make: *** Waiting for unfinished jobs....
   Error: Process completed with exit code 2.

  reply	other threads:[~2022-03-10 22:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08  9:17 [PATCH] selftests/bpf: fix array_size.cocci warning Guo Zhengkui
2022-03-08 14:59 ` Daniel Borkmann
2022-03-08 15:00   ` Daniel Borkmann
2022-03-09  3:22     ` [PATCH v2] " Guo Zhengkui
2022-03-09  3:27       ` Guo Zhengkui
2022-03-09  3:35     ` Guo Zhengkui
2022-03-10 22:08       ` Daniel Borkmann [this message]
2022-03-15 13:01         ` [PATCH v3] " Guo Zhengkui
2022-03-15 16:20           ` patchwork-bot+netdevbpf
2022-03-11 18:38       ` [PATCH v2] " Andrii Nakryiko
2022-03-15 11:48         ` Guo Zhengkui

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=ba71e22a-cf59-b2bd-50c0-d0c9fb3f4e08@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=christylee@fb.com \
    --cc=davemarchevsky@fb.com \
    --cc=delyank@fb.com \
    --cc=guozhengkui@vivo.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=sunyucong@gmail.com \
    --cc=toke@redhat.com \
    --cc=yhs@fb.com \
    --cc=zhengkui_guo@outlook.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