Skip to content

Commit edc0571

Browse files
hramrachborkmann
authored andcommitted
libbpf: Fix pr_warn type warnings on 32bit
The printed value is ptrdiff_t and is formatted wiht %ld. This works on 64bit but produces a warning on 32bit. Fix the format specifier to %td. Fixes: 6723474 ("libbpf: Generate loader program out of BPF ELF file.") Signed-off-by: Michal Suchanek <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 0779890 commit edc0571

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4581,7 +4581,7 @@ static int init_map_slots(struct bpf_object *obj, struct bpf_map *map)
45814581
targ_map = map->init_slots[i];
45824582
fd = bpf_map__fd(targ_map);
45834583
if (obj->gen_loader) {
4584-
pr_warn("// TODO map_update_elem: idx %ld key %d value==map_idx %ld\n",
4584+
pr_warn("// TODO map_update_elem: idx %td key %d value==map_idx %td\n",
45854585
map - obj->maps, i, targ_map - obj->maps);
45864586
return -ENOTSUP;
45874587
} else {
@@ -6205,7 +6205,7 @@ static int bpf_core_apply_relo(struct bpf_program *prog,
62056205
return -EINVAL;
62066206

62076207
if (prog->obj->gen_loader) {
6208-
pr_warn("// TODO core_relo: prog %ld insn[%d] %s %s kind %d\n",
6208+
pr_warn("// TODO core_relo: prog %td insn[%d] %s %s kind %d\n",
62096209
prog - prog->obj->programs, relo->insn_off / 8,
62106210
local_name, spec_str, relo->kind);
62116211
return -ENOTSUP;

0 commit comments

Comments
 (0)