Skip to content

Commit e27bfef

Browse files
fomichevanakryiko
authored andcommitted
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: Stanislav Fomichev <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 63f8af0 commit e27bfef

File tree

1 file changed

+5
-6
lines changed
  • tools/bpf/resolve_btfids

1 file changed

+5
-6
lines changed

tools/bpf/resolve_btfids/main.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ struct object {
115115

116116
static int verbose;
117117

118-
int eprintf(int level, int var, const char *fmt, ...)
118+
static int eprintf(int level, int var, const char *fmt, ...)
119119
{
120120
va_list args;
121-
int ret;
121+
int ret = 0;
122122

123123
if (var >= level) {
124124
va_start(args, fmt);
@@ -385,7 +385,7 @@ static int elf_collect(struct object *obj)
385385
static int symbols_collect(struct object *obj)
386386
{
387387
Elf_Scn *scn = NULL;
388-
int n, i, err = 0;
388+
int n, i;
389389
GElf_Shdr sh;
390390
char *name;
391391

@@ -402,11 +402,10 @@ static int symbols_collect(struct object *obj)
402402
* Scan symbols and look for the ones starting with
403403
* __BTF_ID__* over .BTF_ids section.
404404
*/
405-
for (i = 0; !err && i < n; i++) {
406-
char *tmp, *prefix;
405+
for (i = 0; i < n; i++) {
406+
char *prefix;
407407
struct btf_id *id;
408408
GElf_Sym sym;
409-
int err = -1;
410409

411410
if (!gelf_getsym(obj->efile.symbols, i, &sym))
412411
return -1;

0 commit comments

Comments
 (0)