lkml.org 
[lkml]   [2022]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH bpf-next] bpf: Remove redundant assignment to smap->map.value_size
On Wed, Mar 23, 2022 at 2:21 AM Yuntao Wang <ytcoode@gmail.com> wrote:
>
> The attr->value_size is already assigned to smap->map.value_size
> in bpf_map_init_from_attr(), there is no need to do it again in
> stack_map_alloc()
>
> Signed-off-by: Yuntao Wang <ytcoode@gmail.com>

LGTM.
Acked-by: Joanne Koong <joannelkoong@gmail.com>

> ---
> kernel/bpf/stackmap.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
> index 34725bfa1e97..6131b4a19572 100644
> --- a/kernel/bpf/stackmap.c
> +++ b/kernel/bpf/stackmap.c
> @@ -106,7 +106,6 @@ static struct bpf_map *stack_map_alloc(union bpf_attr *attr)
> return ERR_PTR(-ENOMEM);
>
> bpf_map_init_from_attr(&smap->map, attr);
> - smap->map.value_size = value_size;
> smap->n_buckets = n_buckets;
>
> err = get_callchain_buffers(sysctl_perf_event_max_stack);
> --
> 2.35.0.rc2
>

\
 
 \ /
  Last update: 2022-03-23 18:26    [W:0.047 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site