lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 27 Apr 2022 16:04:16 +0800
From:   kernel test robot <lkp@...el.com>
To:     Andrii Nakryiko <andrii@...nel.org>
Cc:     kbuild-all@...ts.01.org,
        Linux Memory Management List <linux-mm@...ck.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>, netdev@...r.kernel.org,
        bpf@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] libbpf: fix returnvar.cocci warnings

From: kernel test robot <lkp@...el.com>

tools/lib/bpf/relo_core.c:1064:8-11: Unneeded variable: "len". Return "0" on line 1086


 Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Fixes: b58af63aab11 ("libbpf: Refactor CO-RE relo human description formatting routine")
CC: Andrii Nakryiko <andrii@...nel.org>
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: kernel test robot <lkp@...el.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f02ac5c95dfd45d2f50ecc68d79177de326c668c
commit: b58af63aab11e4ae00fe96de9505759cfdde8ee9 [6746/7265] libbpf: Refactor CO-RE relo human description formatting routine
:::::: branch date: 2 hours ago
:::::: commit date: 9 hours ago

 tools/lib/bpf/relo_core.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/tools/lib/bpf/relo_core.c
+++ b/tools/lib/bpf/relo_core.c
@@ -1061,7 +1061,7 @@ static int bpf_core_format_spec(char *bu
 	const struct btf_enum *e;
 	const char *s;
 	__u32 type_id;
-	int i, len = 0;
+	int i;
 
 #define append_buf(fmt, args...)				\
 	({							\
@@ -1083,7 +1083,7 @@ static int bpf_core_format_spec(char *bu
 		   type_id, btf_kind_str(t), str_is_empty(s) ? "<anon>" : s);
 
 	if (core_relo_is_type_based(spec->relo_kind))
-		return len;
+		return 0;
 
 	if (core_relo_is_enumval_based(spec->relo_kind)) {
 		t = skip_mods_and_typedefs(spec->btf, type_id, NULL);
@@ -1091,7 +1091,7 @@ static int bpf_core_format_spec(char *bu
 		s = btf__name_by_offset(spec->btf, e->name_off);
 
 		append_buf("::%s = %u", s, e->val);
-		return len;
+		return 0;
 	}
 
 	if (core_relo_is_field_based(spec->relo_kind)) {
@@ -1110,10 +1110,10 @@ static int bpf_core_format_spec(char *bu
 			append_buf(" @ offset %u.%u)", spec->bit_offset / 8, spec->bit_offset % 8);
 		else
 			append_buf(" @ offset %u)", spec->bit_offset / 8);
-		return len;
+		return 0;
 	}
 
-	return len;
+	return 0;
 #undef append_buf
 }
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ