All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 bpf-next] tools/resolve_btfids: Fix warnings
@ 2021-03-29 22:31 Stanislav Fomichev
  2021-03-29 23:10 ` Song Liu
  2021-03-31 20:28 ` Andrii Nakryiko
  0 siblings, 2 replies; 3+ messages in thread
From: Stanislav Fomichev @ 2021-03-29 22:31 UTC (permalink / raw)
  To: netdev, bpf; +Cc: ast, daniel, Stanislav Fomichev, Song Liu

* make eprintf static, used only in main.c
* initialize ret in eprintf
* remove unused *tmp

v3:
* remove another err (Song Liu)

v2:
* remove unused 'int err = -1'

Cc: Song Liu <song@kernel.org>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
---
 tools/bpf/resolve_btfids/main.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c
index 80d966cfcaa1..7550fd9c3188 100644
--- a/tools/bpf/resolve_btfids/main.c
+++ b/tools/bpf/resolve_btfids/main.c
@@ -115,10 +115,10 @@ struct object {
 
 static int verbose;
 
-int eprintf(int level, int var, const char *fmt, ...)
+static int eprintf(int level, int var, const char *fmt, ...)
 {
 	va_list args;
-	int ret;
+	int ret = 0;
 
 	if (var >= level) {
 		va_start(args, fmt);
@@ -385,7 +385,7 @@ static int elf_collect(struct object *obj)
 static int symbols_collect(struct object *obj)
 {
 	Elf_Scn *scn = NULL;
-	int n, i, err = 0;
+	int n, i;
 	GElf_Shdr sh;
 	char *name;
 
@@ -402,11 +402,10 @@ static int symbols_collect(struct object *obj)
 	 * Scan symbols and look for the ones starting with
 	 * __BTF_ID__* over .BTF_ids section.
 	 */
-	for (i = 0; !err && i < n; i++) {
-		char *tmp, *prefix;
+	for (i = 0; i < n; i++) {
+		char *prefix;
 		struct btf_id *id;
 		GElf_Sym sym;
-		int err = -1;
 
 		if (!gelf_getsym(obj->efile.symbols, i, &sym))
 			return -1;
-- 
2.31.0.291.g576ba9dcdaf-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 bpf-next] tools/resolve_btfids: Fix warnings
  2021-03-29 22:31 [PATCH v3 bpf-next] tools/resolve_btfids: Fix warnings Stanislav Fomichev
@ 2021-03-29 23:10 ` Song Liu
  2021-03-31 20:28 ` Andrii Nakryiko
  1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2021-03-29 23:10 UTC (permalink / raw)
  To: Stanislav Fomichev; +Cc: Networking, bpf, Alexei Starovoitov, Daniel Borkmann

On Mon, Mar 29, 2021 at 3:35 PM Stanislav Fomichev <sdf@google.com> wrote:
>
> * make eprintf static, used only in main.c
> * initialize ret in eprintf
> * remove unused *tmp
>
> v3:
> * remove another err (Song Liu)
>
> v2:
> * remove unused 'int err = -1'
>
> Cc: Song Liu <song@kernel.org>
> Signed-off-by: Stanislav Fomichev <sdf@google.com>

Acked-by: Song Liu <songliubraving@fb.com>
[...]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 bpf-next] tools/resolve_btfids: Fix warnings
  2021-03-29 22:31 [PATCH v3 bpf-next] tools/resolve_btfids: Fix warnings Stanislav Fomichev
  2021-03-29 23:10 ` Song Liu
@ 2021-03-31 20:28 ` Andrii Nakryiko
  1 sibling, 0 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2021-03-31 20:28 UTC (permalink / raw)
  To: Stanislav Fomichev
  Cc: Networking, bpf, Alexei Starovoitov, Daniel Borkmann, Song Liu

On Mon, Mar 29, 2021 at 3:34 PM Stanislav Fomichev <sdf@google.com> wrote:
>
> * make eprintf static, used only in main.c
> * initialize ret in eprintf
> * remove unused *tmp
>
> v3:
> * remove another err (Song Liu)
>
> v2:
> * remove unused 'int err = -1'
>
> Cc: Song Liu <song@kernel.org>
> Signed-off-by: Stanislav Fomichev <sdf@google.com>
> ---

Just in case the bot skips this one. Applied to bpf-next.

[...]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-31 20:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 22:31 [PATCH v3 bpf-next] tools/resolve_btfids: Fix warnings Stanislav Fomichev
2021-03-29 23:10 ` Song Liu
2021-03-31 20:28 ` Andrii Nakryiko

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.