Skip to content

Commit 3285264

Browse files
Jakub Kicinskiborkmann
authored andcommitted
bpf: arraymap: use bpf_map_init_from_attr()
Arraymap was not converted to use bpf_map_init_from_attr() to avoid merge conflicts with emergency fixes. Do it now. Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent ad46061 commit 3285264

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

kernel/bpf/arraymap.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,7 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr)
120120
array->map.unpriv_array = unpriv;
121121

122122
/* copy mandatory map attributes */
123-
array->map.map_type = attr->map_type;
124-
array->map.key_size = attr->key_size;
125-
array->map.value_size = attr->value_size;
126-
array->map.max_entries = attr->max_entries;
127-
array->map.map_flags = attr->map_flags;
128-
array->map.numa_node = numa_node;
123+
bpf_map_init_from_attr(&array->map, attr);
129124
array->elem_size = elem_size;
130125

131126
if (!percpu)

0 commit comments

Comments
 (0)