Commit 9fc9aad9 authored by Tobias Klauser's avatar Tobias Klauser Committed by Daniel Borkmann

libbpf: Remove unused parameter `def` to get_map_field_int

Has been unused since commit ef99b02b ("libbpf: capture value in BTF
type info for BTF-defined map defs").
Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Reviewed-by: default avatarQuentin Monnet <quentin@isovalent.com>
Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200325113655.19341-1-tklauser@distanz.ch
parent 8c061865
...@@ -1845,7 +1845,6 @@ resolve_func_ptr(const struct btf *btf, __u32 id, __u32 *res_id) ...@@ -1845,7 +1845,6 @@ resolve_func_ptr(const struct btf *btf, __u32 id, __u32 *res_id)
* type definition, while using only sizeof(void *) space in ELF data section. * type definition, while using only sizeof(void *) space in ELF data section.
*/ */
static bool get_map_field_int(const char *map_name, const struct btf *btf, static bool get_map_field_int(const char *map_name, const struct btf *btf,
const struct btf_type *def,
const struct btf_member *m, __u32 *res) const struct btf_member *m, __u32 *res)
{ {
const struct btf_type *t = skip_mods_and_typedefs(btf, m->type, NULL); const struct btf_type *t = skip_mods_and_typedefs(btf, m->type, NULL);
...@@ -1972,19 +1971,19 @@ static int bpf_object__init_user_btf_map(struct bpf_object *obj, ...@@ -1972,19 +1971,19 @@ static int bpf_object__init_user_btf_map(struct bpf_object *obj,
return -EINVAL; return -EINVAL;
} }
if (strcmp(name, "type") == 0) { if (strcmp(name, "type") == 0) {
if (!get_map_field_int(map_name, obj->btf, def, m, if (!get_map_field_int(map_name, obj->btf, m,
&map->def.type)) &map->def.type))
return -EINVAL; return -EINVAL;
pr_debug("map '%s': found type = %u.\n", pr_debug("map '%s': found type = %u.\n",
map_name, map->def.type); map_name, map->def.type);
} else if (strcmp(name, "max_entries") == 0) { } else if (strcmp(name, "max_entries") == 0) {
if (!get_map_field_int(map_name, obj->btf, def, m, if (!get_map_field_int(map_name, obj->btf, m,
&map->def.max_entries)) &map->def.max_entries))
return -EINVAL; return -EINVAL;
pr_debug("map '%s': found max_entries = %u.\n", pr_debug("map '%s': found max_entries = %u.\n",
map_name, map->def.max_entries); map_name, map->def.max_entries);
} else if (strcmp(name, "map_flags") == 0) { } else if (strcmp(name, "map_flags") == 0) {
if (!get_map_field_int(map_name, obj->btf, def, m, if (!get_map_field_int(map_name, obj->btf, m,
&map->def.map_flags)) &map->def.map_flags))
return -EINVAL; return -EINVAL;
pr_debug("map '%s': found map_flags = %u.\n", pr_debug("map '%s': found map_flags = %u.\n",
...@@ -1992,8 +1991,7 @@ static int bpf_object__init_user_btf_map(struct bpf_object *obj, ...@@ -1992,8 +1991,7 @@ static int bpf_object__init_user_btf_map(struct bpf_object *obj,
} else if (strcmp(name, "key_size") == 0) { } else if (strcmp(name, "key_size") == 0) {
__u32 sz; __u32 sz;
if (!get_map_field_int(map_name, obj->btf, def, m, if (!get_map_field_int(map_name, obj->btf, m, &sz))
&sz))
return -EINVAL; return -EINVAL;
pr_debug("map '%s': found key_size = %u.\n", pr_debug("map '%s': found key_size = %u.\n",
map_name, sz); map_name, sz);
...@@ -2035,8 +2033,7 @@ static int bpf_object__init_user_btf_map(struct bpf_object *obj, ...@@ -2035,8 +2033,7 @@ static int bpf_object__init_user_btf_map(struct bpf_object *obj,
} else if (strcmp(name, "value_size") == 0) { } else if (strcmp(name, "value_size") == 0) {
__u32 sz; __u32 sz;
if (!get_map_field_int(map_name, obj->btf, def, m, if (!get_map_field_int(map_name, obj->btf, m, &sz))
&sz))
return -EINVAL; return -EINVAL;
pr_debug("map '%s': found value_size = %u.\n", pr_debug("map '%s': found value_size = %u.\n",
map_name, sz); map_name, sz);
...@@ -2079,8 +2076,7 @@ static int bpf_object__init_user_btf_map(struct bpf_object *obj, ...@@ -2079,8 +2076,7 @@ static int bpf_object__init_user_btf_map(struct bpf_object *obj,
__u32 val; __u32 val;
int err; int err;
if (!get_map_field_int(map_name, obj->btf, def, m, if (!get_map_field_int(map_name, obj->btf, m, &val))
&val))
return -EINVAL; return -EINVAL;
pr_debug("map '%s': found pinning = %u.\n", pr_debug("map '%s': found pinning = %u.\n",
map_name, val); map_name, val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment