Blob Blame History Raw
From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 16 Jan 2020 22:53:00 +0800
Subject: bpf: Remove set but not used variable 'first_key'
Patch-mainline: v5.6-rc1
Git-commit: 81f2b572cf4fd5c4178fe0e2b5bb1ab096385fd8
References: bsc#1177028

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.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Brian Vazquez <brianvv@google.com>
Link: https://lore.kernel.org/bpf/20200116145300.59056-1-yuehaibing@huawei.com
Acked-by: Gary Lin <glin@suse.com>
---
 kernel/bpf/syscall.c |    2 --
 1 file changed, 2 deletions(-)

--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -1336,7 +1336,6 @@ int generic_map_lookup_batch(struct bpf_
 	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_
 	}
 
 	err = -EFAULT;
-	first_key = false;
 	prev_key = NULL;
 	if (ubatch && copy_from_user(buf_prevkey, ubatch, map->key_size))
 		goto free_buf;