aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAlexei Starovoitov <[email protected]>2024-06-20 19:50:27 -0700
committerAlexei Starovoitov <[email protected]>2024-06-20 19:50:33 -0700
commitbf977ee4a9e2ad8a41b3a2497aada5e7eb09eaea (patch)
tree008909b701e35b7a7c65c468684f2e7ca18235fe /kernel
parent3b06304370931f90cd6f50ea9dd55603429b13dc (diff)
parent21ab4980e02d495174bc64c00ceb4d3cf87fadb1 (diff)
Merge branch 'fix-compiler-warnings-looking-for-suggestions'
Rafael Passos says: ==================== Fix compiler warnings, looking for suggestions Hi, This patchset has a few fixes to compiler warnings. I am studying the BPF subsystem and wish to bring more tangible contributions. I would appreciate receiving suggestions on things to investigate. I also documented a bit in my blog. I could help with docs here, too. https://rcpassos.me/post/linux-ebpf-understanding-kernel-level-mechanics Thanks! Changelog V1 -> V2: - rebased all commits to updated for-next base - removes new cases of the extra parameter for bpf_jit_binary_pack_finalize - built and tested for ARM64 - sent the series for the test workflow: https://github.com/kernel-patches/bpf/pull/7198 ==================== Acked-by: Puranjay Mohan <[email protected]> Acked-by: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/core.c8
-rw-r--r--kernel/bpf/log.c2
-rw-r--r--kernel/bpf/verifier.c3
3 files changed, 5 insertions, 8 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 1a6c3faa6e4a..ae2e1eeda0d4 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -1174,8 +1174,7 @@ bpf_jit_binary_pack_alloc(unsigned int proglen, u8 **image_ptr,
}
/* Copy JITed text from rw_header to its final location, the ro_header. */
-int bpf_jit_binary_pack_finalize(struct bpf_prog *prog,
- struct bpf_binary_header *ro_header,
+int bpf_jit_binary_pack_finalize(struct bpf_binary_header *ro_header,
struct bpf_binary_header *rw_header)
{
void *ptr;
@@ -2743,8 +2742,7 @@ static void bpf_free_used_maps(struct bpf_prog_aux *aux)
kfree(aux->used_maps);
}
-void __bpf_free_used_btfs(struct bpf_prog_aux *aux,
- struct btf_mod_pair *used_btfs, u32 len)
+void __bpf_free_used_btfs(struct btf_mod_pair *used_btfs, u32 len)
{
#ifdef CONFIG_BPF_SYSCALL
struct btf_mod_pair *btf_mod;
@@ -2761,7 +2759,7 @@ void __bpf_free_used_btfs(struct bpf_prog_aux *aux,
static void bpf_free_used_btfs(struct bpf_prog_aux *aux)
{
- __bpf_free_used_btfs(aux, aux->used_btfs, aux->used_btf_cnt);
+ __bpf_free_used_btfs(aux->used_btfs, aux->used_btf_cnt);
kfree(aux->used_btfs);
}
diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
index 3f4ae92e549f..5aebfc3051e3 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)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index ffe98a788c33..3f6be4923655 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -18694,8 +18694,7 @@ static void release_maps(struct bpf_verifier_env *env)
/* drop refcnt of maps used by the rejected program */
static void release_btfs(struct bpf_verifier_env *env)
{
- __bpf_free_used_btfs(env->prog->aux, env->used_btfs,
- env->used_btf_cnt);
+ __bpf_free_used_btfs(env->used_btfs, env->used_btf_cnt);
}
/* convert pseudo BPF_LD_IMM64 into generic BPF_LD_IMM64 */