Commit e27bfefb authored by Stanislav Fomichev's avatar Stanislav Fomichev Committed by Andrii Nakryiko

tools/resolve_btfids: Fix warnings

* 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'
Signed-off-by: default avatarStanislav Fomichev <sdf@google.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20210329223143.3659983-1-sdf@google.com
parent 63f8af0f
...@@ -115,10 +115,10 @@ struct object { ...@@ -115,10 +115,10 @@ struct object {
static int verbose; 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; va_list args;
int ret; int ret = 0;
if (var >= level) { if (var >= level) {
va_start(args, fmt); va_start(args, fmt);
...@@ -385,7 +385,7 @@ static int elf_collect(struct object *obj) ...@@ -385,7 +385,7 @@ static int elf_collect(struct object *obj)
static int symbols_collect(struct object *obj) static int symbols_collect(struct object *obj)
{ {
Elf_Scn *scn = NULL; Elf_Scn *scn = NULL;
int n, i, err = 0; int n, i;
GElf_Shdr sh; GElf_Shdr sh;
char *name; char *name;
...@@ -402,11 +402,10 @@ static int symbols_collect(struct object *obj) ...@@ -402,11 +402,10 @@ static int symbols_collect(struct object *obj)
* Scan symbols and look for the ones starting with * Scan symbols and look for the ones starting with
* __BTF_ID__* over .BTF_ids section. * __BTF_ID__* over .BTF_ids section.
*/ */
for (i = 0; !err && i < n; i++) { for (i = 0; i < n; i++) {
char *tmp, *prefix; char *prefix;
struct btf_id *id; struct btf_id *id;
GElf_Sym sym; GElf_Sym sym;
int err = -1;
if (!gelf_getsym(obj->efile.symbols, i, &sym)) if (!gelf_getsym(obj->efile.symbols, i, &sym))
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment