BPF List
 help / color / mirror / Atom feed
From: Rafael Passos <rafael@rcpassos.me>
To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org
Cc: Rafael Passos <rafael@rcpassos.me>, bpf@vger.kernel.org
Subject: [PATCH bpf-next V2 3/3] bpf: remove redeclaration of new_n in bpf_verifier_vlog
Date: Fri, 14 Jun 2024 23:24:10 -0300	[thread overview]
Message-ID: <20240615022641.210320-4-rafael@rcpassos.me> (raw)
In-Reply-To: <20240615022641.210320-1-rafael@rcpassos.me>

This new_n is defined in the start of this function.
Its value is overwritten by `new_n = min(n, log->len_total);`
a couple lines before my change,
rendering the shadow declaration unnecessary.

Signed-off-by: Rafael Passos <rafael@rcpassos.me>
---
 kernel/bpf/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
index 4bd8f17a9f24..10b2ed6995eb 100644
--- a/kernel/bpf/log.c
+++ b/kernel/bpf/log.c
@@ -91,7 +91,7 @@ void bpf_verifier_vlog(struct bpf_verifier_log *log, const char *fmt,
 			goto fail;
 	} else {
 		u64 new_end, new_start;
-		u32 buf_start, buf_end, new_n;
+		u32 buf_start, buf_end;
 
 		new_end = log->end_pos + n;
 		if (new_end - log->start_pos >= log->len_total)
-- 
2.45.2


  parent reply	other threads:[~2024-06-15  2:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-15  2:24 [PATCH bpf-next V2 0/3] Fix compiler warnings, looking for suggestions Rafael Passos
2024-06-15  2:24 ` [PATCH bpf-next V2 1/3] bpf: remove unused parameter in bpf_jit_binary_pack_finalize Rafael Passos
2024-06-15  2:24 ` [PATCH bpf-next V2 2/3] bpf: remove unused parameter in __bpf_free_used_btfs Rafael Passos
2024-06-15  2:24 ` Rafael Passos [this message]
2024-06-17  8:45 ` [PATCH bpf-next V2 0/3] Fix compiler warnings, looking for suggestions Jiri Olsa
2024-06-18  2:34   ` Rafael Passos
2024-06-18 14:20 ` Puranjay Mohan
2024-06-21  3:00 ` 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=20240615022641.210320-4-rafael@rcpassos.me \
    --to=rafael@rcpassos.me \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox