From: Brian Vazquez <brianvv@google.com>
To: YueHaibing <yuehaibing@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
kafai@fb.com, songliubraving@fb.com, Yonghong Song <yhs@fb.com>,
andriin@fb.com, Linux NetDev <netdev@vger.kernel.org>,
bpf <bpf@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf-next] bpf: Remove set but not used variable 'first_key'
Date: Thu, 16 Jan 2020 17:41:24 -0800 [thread overview]
Message-ID: <CAMzD94T3TowoygCu3mAtd3WaZtSk1m1AVVpUHYB_bPAyE9QS3A@mail.gmail.com> (raw)
In-Reply-To: <20200116145300.59056-1-yuehaibing@huawei.com>
On Thu, Jan 16, 2020 at 5:38 PM YueHaibing <yuehaibing@huawei.com> wrote:
>
> kernel/bpf/syscall.c: In function generic_map_lookup_batch:
> kernel/bpf/syscall.c:1339:7: warning: variable first_key set but not used [-Wunused-but-set-variable]
>
> It is never used, so remove it.
Previous logic was using it but I forgot to delete it. Thanks for fixing it!
Acked-by: Brian Vazquez <brianvv@google.com>
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> kernel/bpf/syscall.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index 0d94d36..c26a714 100644
> --- a/kernel/bpf/syscall.c
> +++ b/kernel/bpf/syscall.c
> @@ -1336,7 +1336,6 @@ int generic_map_lookup_batch(struct bpf_map *map,
> void *buf, *buf_prevkey, *prev_key, *key, *value;
> int err, retry = MAP_LOOKUP_RETRIES;
> u32 value_size, cp, max_count;
> - bool first_key = false;
>
> if (attr->batch.elem_flags & ~BPF_F_LOCK)
> return -EINVAL;
> @@ -1365,7 +1364,6 @@ int generic_map_lookup_batch(struct bpf_map *map,
> }
>
> err = -EFAULT;
> - first_key = false;
> prev_key = NULL;
> if (ubatch && copy_from_user(buf_prevkey, ubatch, map->key_size))
> goto free_buf;
> --
> 2.7.4
>
>
next prev parent reply other threads:[~2020-01-17 1:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 14:53 [PATCH bpf-next] bpf: Remove set but not used variable 'first_key' YueHaibing
2020-01-17 1:41 ` Brian Vazquez [this message]
2020-01-17 4:19 ` Alexei Starovoitov
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=CAMzD94T3TowoygCu3mAtd3WaZtSk1m1AVVpUHYB_bPAyE9QS3A@mail.gmail.com \
--to=brianvv@google.com \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
--cc=yuehaibing@huawei.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;
as well as URLs for NNTP newsgroup(s).