* [PATCH] libbpf: remove unused parameter `def` to get_map_field_int
@ 2020-03-25 11:36 Tobias Klauser
2020-03-25 12:06 ` Quentin Monnet
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tobias Klauser @ 2020-03-25 11:36 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann; +Cc: Andrii Nakryiko, bpf
Has been unused since commit ef99b02b23ef ("libbpf: capture value in BTF
type info for BTF-defined map defs").
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
tools/lib/bpf/libbpf.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 085e41f9b68e..e9479ad9dd51 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -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.
*/
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_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,
return -EINVAL;
}
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))
return -EINVAL;
pr_debug("map '%s': found type = %u.\n",
map_name, map->def.type);
} 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))
return -EINVAL;
pr_debug("map '%s': found max_entries = %u.\n",
map_name, map->def.max_entries);
} 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))
return -EINVAL;
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,
} else if (strcmp(name, "key_size") == 0) {
__u32 sz;
- if (!get_map_field_int(map_name, obj->btf, def, m,
- &sz))
+ if (!get_map_field_int(map_name, obj->btf, m, &sz))
return -EINVAL;
pr_debug("map '%s': found key_size = %u.\n",
map_name, sz);
@@ -2035,8 +2033,7 @@ static int bpf_object__init_user_btf_map(struct bpf_object *obj,
} else if (strcmp(name, "value_size") == 0) {
__u32 sz;
- if (!get_map_field_int(map_name, obj->btf, def, m,
- &sz))
+ if (!get_map_field_int(map_name, obj->btf, m, &sz))
return -EINVAL;
pr_debug("map '%s': found value_size = %u.\n",
map_name, sz);
@@ -2079,8 +2076,7 @@ static int bpf_object__init_user_btf_map(struct bpf_object *obj,
__u32 val;
int err;
- if (!get_map_field_int(map_name, obj->btf, def, m,
- &val))
+ if (!get_map_field_int(map_name, obj->btf, m, &val))
return -EINVAL;
pr_debug("map '%s': found pinning = %u.\n",
map_name, val);
--
2.26.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] libbpf: remove unused parameter `def` to get_map_field_int
2020-03-25 11:36 [PATCH] libbpf: remove unused parameter `def` to get_map_field_int Tobias Klauser
@ 2020-03-25 12:06 ` Quentin Monnet
2020-03-25 18:52 ` Andrii Nakryiko
2020-03-25 23:20 ` Daniel Borkmann
2 siblings, 0 replies; 4+ messages in thread
From: Quentin Monnet @ 2020-03-25 12:06 UTC (permalink / raw)
To: Tobias Klauser, Alexei Starovoitov, Daniel Borkmann; +Cc: Andrii Nakryiko, bpf
2020-03-25 12:36 UTC+0100 ~ Tobias Klauser <tklauser@distanz.ch>
> Has been unused since commit ef99b02b23ef ("libbpf: capture value in BTF
> type info for BTF-defined map defs").
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libbpf: remove unused parameter `def` to get_map_field_int
2020-03-25 11:36 [PATCH] libbpf: remove unused parameter `def` to get_map_field_int Tobias Klauser
2020-03-25 12:06 ` Quentin Monnet
@ 2020-03-25 18:52 ` Andrii Nakryiko
2020-03-25 23:20 ` Daniel Borkmann
2 siblings, 0 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2020-03-25 18:52 UTC (permalink / raw)
To: Tobias Klauser; +Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf
On Wed, Mar 25, 2020 at 4:37 AM Tobias Klauser <tklauser@distanz.ch> wrote:
>
> Has been unused since commit ef99b02b23ef ("libbpf: capture value in BTF
> type info for BTF-defined map defs").
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
Sure, why not. LGTM.
Acked-by: Andrii Nakryiko <andriin@fb.com>
> tools/lib/bpf/libbpf.c | 16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)
>
[...]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libbpf: remove unused parameter `def` to get_map_field_int
2020-03-25 11:36 [PATCH] libbpf: remove unused parameter `def` to get_map_field_int Tobias Klauser
2020-03-25 12:06 ` Quentin Monnet
2020-03-25 18:52 ` Andrii Nakryiko
@ 2020-03-25 23:20 ` Daniel Borkmann
2 siblings, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2020-03-25 23:20 UTC (permalink / raw)
To: Tobias Klauser, Alexei Starovoitov; +Cc: Andrii Nakryiko, bpf
On 3/25/20 12:36 PM, Tobias Klauser wrote:
> Has been unused since commit ef99b02b23ef ("libbpf: capture value in BTF
> type info for BTF-defined map defs").
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Applied, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-25 23:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 11:36 [PATCH] libbpf: remove unused parameter `def` to get_map_field_int Tobias Klauser
2020-03-25 12:06 ` Quentin Monnet
2020-03-25 18:52 ` Andrii Nakryiko
2020-03-25 23:20 ` Daniel Borkmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).