From: Yonghong Song <yhs@fb.com>
To: Bo YU <tsu.yubo@gmail.com>, "ast@kernel.org" <ast@kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
Martin Lau <kafai@fb.com>,
"ongliubraving@fb.com" <ongliubraving@fb.com>,
"davem@davemloft.net" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"yuzibode@126.com" <yuzibode@126.com>
Subject: Re: [PATCH] bpf: fix warning about using plain integer as NULL
Date: Fri, 8 Mar 2019 05:44:56 +0000 [thread overview]
Message-ID: <ffd0ded7-77b3-f0fc-920d-365510d00e6c@fb.com> (raw)
In-Reply-To: <20190308043956.16906-1-tsu.yubo@gmail.com>
On 3/7/19 8:39 PM, Bo YU wrote:
> Sparse warning below:
>
> sudo make C=2 CF=-D__CHECK_ENDIAN__ M=net/bpf/
> CHECK net/bpf//test_run.c
> net/bpf//test_run.c:19:77: warning: Using plain integer as NULL pointer
> ./include/linux/bpf-cgroup.h:295:77: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Could you add proper fixes like below:
Fixes: 8bad74f9840f ("bpf: extend cgroup bpf core to allow multiple
cgroup storage types")
With that,
Acked-by: Yonghong Song <yhs@fb.com>
> ---
> include/linux/bpf-cgroup.h | 2 +-
> net/bpf/test_run.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
> index 695b2a880d9a..a4c644c1c091 100644
> --- a/include/linux/bpf-cgroup.h
> +++ b/include/linux/bpf-cgroup.h
> @@ -292,7 +292,7 @@ static inline int bpf_cgroup_storage_assign(struct bpf_prog *prog,
> static inline void bpf_cgroup_storage_release(struct bpf_prog *prog,
> struct bpf_map *map) {}
> static inline struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(
> - struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return 0; }
> + struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return NULL; }
> static inline void bpf_cgroup_storage_free(
> struct bpf_cgroup_storage *storage) {}
> static inline int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key,
> diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
> index da7051d62727..fab142b796ef 100644
> --- a/net/bpf/test_run.c
> +++ b/net/bpf/test_run.c
> @@ -16,7 +16,7 @@
> static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat,
> u32 *retval, u32 *time)
> {
> - struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { 0 };
> + struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { NULL };
> enum bpf_cgroup_storage_type stype;
> u64 time_start, time_spent = 0;
> int ret = 0;
>
prev parent reply other threads:[~2019-03-08 5:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 4:39 Bo YU
2019-03-08 5:44 ` Yonghong Song [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=ffd0ded7-77b3-f0fc-920d-365510d00e6c@fb.com \
--to=yhs@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=kafai@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ongliubraving@fb.com \
--cc=tsu.yubo@gmail.com \
--cc=yuzibode@126.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
all inboxes | Powered by JetHome®