On Fri, Sep 5, 2025 at 9:45 AM Mykyta Yatsenko <mykyta.yatsenko5@xxxxxxxxx> wrote: > > From: Mykyta Yatsenko <yatsenko@xxxxxxxx> > > Calculation of the BPF map key, given the pointer to a value is > duplicated in a couple of places in helpers already, in the next patch > another use case is introduced as well. > This patch extracts that functionality into a separate function. > > Signed-off-by: Mykyta Yatsenko <yatsenko@xxxxxxxx> > Acked-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> > --- > kernel/bpf/helpers.c | 31 ++++++++++++++----------------- > 1 file changed, 14 insertions(+), 17 deletions(-) > lgtm Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx> > diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c > index 89a5d8808ce8..109cb249e88c 100644 > --- a/kernel/bpf/helpers.c > +++ b/kernel/bpf/helpers.c > @@ -1081,6 +1081,18 @@ const struct bpf_func_proto bpf_snprintf_proto = { > .arg5_type = ARG_CONST_SIZE_OR_ZERO, > }; > [...]