Skip to content

Commit

Permalink
bpf: Remove redundant assignment to smap->map.value_size
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Joanne Koong <joannelkoong@gmail.com>
Link: https://lore.kernel.org/bpf/20220323073626.958652-1-ytcoode@gmail.com
  • Loading branch information
ytcoode authored and borkmann committed Apr 1, 2022
1 parent fe4625d commit 8eb943f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion kernel/bpf/stackmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8eb943f

Please sign in to comment.