Re: [PATCH bpf-next 02/13] bpf: Factor out update_fentry_multi helper

[email protected]
Newsgroups org.kernel.vger.bpf
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The `orig_flags` parameter in the new `update_fentry_multi` helper function is unused.
--

--- Patch [2]: [PATCH bpf-next 02/13] bpf: Factor out update_fentry_multi helper ---
commit c90e2dad924e48bb1043b67addb36ec916a663d1
Author: Leon Hwang <[email protected]>

bpf: Factor out update_fentry_multi helper

This commit factors out common functionality from the register, unregister,
and modify multi fentry callbacks into a new update_fentry_multi helper.

> diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
> index 8c2c1d1b90941..6e1898e1b200f 100644
> --- a/kernel/bpf/trampoline.c
> +++ b/kernel/bpf/trampoline.c
> @@ -1568,47 +1568,41 @@ static void ftrace_hash_add(struct ftrace_hash *hash, struct ftrace_func_entry *
>  	add_ftrace_hash_entry(hash, entry);
>  }
>  
> -static int register_fentry_multi(struct bpf_trampoline *tr, struct bpf_tramp_image *im, void *ptr)
> +static int update_fentry_multi(struct bpf_trampoline *tr, u32 orig_flags,
> +			       struct bpf_tramp_image *im, struct ftrace_hash *hash,
> +			       struct bpf_tracing_multi_data *data)
>  {

[Severity: Low]
Is it intended to keep the orig_flags parameter here? It appears to be
completely unused in the body of this new helper function.

> -	unsigned long addr = (unsigned long) im->image;
> +	unsigned long addr = (unsigned long)(im ? im->image : tr->cur_image->image);
>  	unsigned long ip = ftrace_location(tr->ip);
> -	struct bpf_tracing_multi_data *data = ptr;

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.