All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guo Zhengkui <guozhengkui@vivo.com>
To: daniel@iogearbox.net
Cc: andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org,
	davemarchevsky@fb.com, guozhengkui@vivo.com,
	john.fastabend@gmail.com, kafai@fb.com, kernel@vivo.com,
	kpsingh@kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
	shuah@kernel.org, songliubraving@fb.com, sunyucong@gmail.com,
	yhs@fb.com
Subject: Re: [PATCH] selftests/bpf: fix array_size.cocci warning
Date: Thu, 18 Nov 2021 15:11:28 +0800	[thread overview]
Message-ID: <20211118071128.13519-1-guozhengkui@vivo.com> (raw)
In-Reply-To: <8f387f33-51f7-feea-d366-ceb5bbed0b51@iogearbox.net>

> No need for the extra include. test_progs.h already includes bpf_util.h, please check
> such trivialities before submission. Simple grep would have revealed use of ARRAY_SIZE()
> in various places under tools/testing/selftests/bpf/prog_tests/.

Actually, ARRAY_SIZE() in ./include/linux/kernel.h is diffrent from the one defined in bpf_util.h:

./include/linux/kernel.h
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))

./tools/testing/selftests/bpf/bpf_util.h
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

__must_be_array() ensures arr is an array, which is better than the one defined in bpf_util.h

> here are many more similar occurrences. Please just send one cleanup patch to reduce churn in the git log.

Yes, I will commit another patch.

  reply	other threads:[~2021-11-18  7:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 13:20 [PATCH] selftests/bpf: fix array_size.cocci warning: Guo Zhengkui
2021-11-17 22:42 ` Daniel Borkmann
2021-11-18  7:11   ` Guo Zhengkui [this message]
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

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=20211118071128.13519-1-guozhengkui@vivo.com \
    --to=guozhengkui@vivo.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davemarchevsky@fb.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kernel@vivo.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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.