All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii@kernel.org>
To: <bpf@vger.kernel.org>, <ast@kernel.org>, <daniel@iogearbox.net>,
	<martin.lau@kernel.org>
Cc: <andrii@kernel.org>, <kernel-team@meta.com>
Subject: [PATCH v3 bpf-next 4/4] veristat: small fixed found in -O2 mode
Date: Fri, 31 Mar 2023 15:24:05 -0700	[thread overview]
Message-ID: <20230331222405.3468634-5-andrii@kernel.org> (raw)
In-Reply-To: <20230331222405.3468634-1-andrii@kernel.org>

Fix few potentially unitialized variables uses, found while building
veristat.c in release (-O2) mode.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
 tools/testing/selftests/bpf/veristat.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c
index e592d05bccb2..53d7ec168268 100644
--- a/tools/testing/selftests/bpf/veristat.c
+++ b/tools/testing/selftests/bpf/veristat.c
@@ -810,7 +810,7 @@ static int guess_prog_type_by_ctx_name(const char *ctx_name,
 		enum bpf_prog_type prog_type;
 		enum bpf_attach_type attach_type;
 	} ctx_map[] = {
-		/* __sk_buff is most ambiguous, for now we assume cgroup_skb */
+		/* __sk_buff is most ambiguous, we assume TC program */
 		{ "__sk_buff", "sk_buff", BPF_PROG_TYPE_SCHED_CLS },
 		{ "bpf_sock", "sock", BPF_PROG_TYPE_CGROUP_SOCK, BPF_CGROUP_INET4_POST_BIND },
 		{ "bpf_sock_addr", "bpf_sock_addr_kern",  BPF_PROG_TYPE_CGROUP_SOCK_ADDR, BPF_CGROUP_INET4_BIND },
@@ -1045,6 +1045,7 @@ static int process_obj(const char *filename)
 			goto cleanup;
 		}
 
+		lprog = NULL;
 		bpf_object__for_each_program(tprog, tobj) {
 			const char *tprog_name = bpf_program__name(tprog);
 
@@ -1855,6 +1856,7 @@ static int handle_comparison_mode(void)
 one_more_time:
 	output_comp_headers(cur_fmt);
 
+	last_idx = -1;
 	for (i = 0; i < env.join_stat_cnt; i++) {
 		const struct verif_stats_join *join = &env.join_stats[i];
 
-- 
2.34.1


  parent reply	other threads:[~2023-03-31 22:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 22:24 [PATCH v3 bpf-next 0/4] Prepare veristat for packaging Andrii Nakryiko
2023-03-31 22:24 ` [PATCH v3 bpf-next 1/4] veristat: relicense veristat.c as dual GPL-2.0-only or BSD-2-Clause licensed Andrii Nakryiko
2023-03-31 22:24 ` [PATCH v3 bpf-next 2/4] veristat: improve version reporting Andrii Nakryiko
2023-03-31 22:24 ` [PATCH v3 bpf-next 3/4] veristat: avoid using kernel-internal headers Andrii Nakryiko
2023-03-31 22:24 ` Andrii Nakryiko [this message]
2023-04-01 16:10 ` [PATCH v3 bpf-next 0/4] Prepare veristat for packaging patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230331222405.3468634-5-andrii@kernel.org \
    --to=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.