tools/resolve_btfids: Fix warnings
Subsystems (3)
PATCH v3 1/1 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'
Cc Song Liu <[email protected]>
Signed-off-by Stanislav Fomichev <[email protected]>
--- tools/bpf/resolve_btfids/main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
tools/bpf/resolve_btfids/main.c +5 -6
@@ -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 ;
Signature · 1 line
2.31.0.291.g576ba9dcdaf-goog
Quoted 5 lines · Stanislav Fomichev
* make eprintf static, used only in
main.c
* initialize ret in eprintf
* remove unused *tmp
Quoted 8 lines
v3:
* remove another err (Song Liu)v2:
* remove unused 'int err = -1'Cc Song Liu <[email protected]>Signed-off-by Stanislav Fomichev <[email protected]>
Acked-by Song Liu <[email protected]>
[...]
Quoted 8 lines · Stanislav Fomichev
* make eprintf static, used only in
main.c
* initialize ret in eprintf
* remove unused *tmpv3:
* remove another err (Song Liu)
Quoted 6 lines
v2:
* remove unused 'int err = -1'Cc Song Liu <[email protected]>Signed-off-by Stanislav Fomichev <[email protected]>---
Just in case the bot skips this one. Applied to bpf-next.
[...]