diff mbox series

[bpf-next] tools/resolve_btfids: Fix warnings

Message ID 20210329162416.2712509-1-sdf@google.com (mailing list archive)
State Superseded
Delegated to: BPF
Headers show
Series [bpf-next] tools/resolve_btfids: Fix warnings | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 9 maintainers not CCed: jackmanb@google.com jetswayss@gmail.com yhs@fb.com kpsingh@kernel.org andrii@kernel.org jolsa@kernel.org kafai@fb.com john.fastabend@gmail.com songliubraving@fb.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Stanislav Fomichev March 29, 2021, 4:24 p.m. UTC
* make eprintf static, used only in main.c
* initialize ret in eprintf
* remove unused *tmp

Signed-off-by: Stanislav Fomichev <sdf@google.com>
---
 tools/bpf/resolve_btfids/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stanislav Fomichev March 29, 2021, 4:39 p.m. UTC | #1
On 03/29, Stanislav Fomichev wrote:
> * make eprintf static, used only in main.c
> * initialize ret in eprintf
> * remove unused *tmp

> Signed-off-by: Stanislav Fomichev <sdf@google.com>
> ---
>   tools/bpf/resolve_btfids/main.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)

> diff --git a/tools/bpf/resolve_btfids/main.c  
> b/tools/bpf/resolve_btfids/main.c
> index 80d966cfcaa1..a650422f7430 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);
> @@ -403,7 +403,7 @@ static int symbols_collect(struct object *obj)
>   	 * __BTF_ID__* over .BTF_ids section.
>   	 */
>   	for (i = 0; !err && i < n; i++) {
> -		char *tmp, *prefix;
> +		char *prefix;
>   		struct btf_id *id;
>   		GElf_Sym sym;
>   		int err = -1;
> --
> 2.31.0.291.g576ba9dcdaf-goog


Looks like that 'int err = -1' is also unused.
I'll respin, please ignore this one. Sorry for the noise.
diff mbox series

Patch

diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c
index 80d966cfcaa1..a650422f7430 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);
@@ -403,7 +403,7 @@  static int symbols_collect(struct object *obj)
 	 * __BTF_ID__* over .BTF_ids section.
 	 */
 	for (i = 0; !err && i < n; i++) {
-		char *tmp, *prefix;
+		char *prefix;
 		struct btf_id *id;
 		GElf_Sym sym;
 		int err = -1;