]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
libbpf: Fix pr_warn type warnings on 32bit
authorMichal Suchanek <msuchanek@suse.de>
Fri, 4 Jun 2021 11:24:48 +0000 (13:24 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 8 Jun 2021 20:02:10 +0000 (22:02 +0200)
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: 67234743736a ("libbpf: Generate loader program out of BPF ELF file.")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210604112448.32297-1-msuchanek@suse.de
tools/lib/bpf/libbpf.c

index 1c4e20e75237d3e49bee5979d7dd6001e53b5b1d..65f87cc1220c006dd42c8d1c1886c7a67fba6b12 100644 (file)
@@ -4581,7 +4581,7 @@ static int init_map_slots(struct bpf_object *obj, struct bpf_map *map)
                targ_map = map->init_slots[i];
                fd = bpf_map__fd(targ_map);
                if (obj->gen_loader) {
-                       pr_warn("// TODO map_update_elem: idx %ld key %d value==map_idx %ld\n",
+                       pr_warn("// TODO map_update_elem: idx %td key %d value==map_idx %td\n",
                                map - obj->maps, i, targ_map - obj->maps);
                        return -ENOTSUP;
                } else {
@@ -6205,7 +6205,7 @@ static int bpf_core_apply_relo(struct bpf_program *prog,
                return -EINVAL;
 
        if (prog->obj->gen_loader) {
-               pr_warn("// TODO core_relo: prog %ld insn[%d] %s %s kind %d\n",
+               pr_warn("// TODO core_relo: prog %td insn[%d] %s %s kind %d\n",
                        prog - prog->obj->programs, relo->insn_off / 8,
                        local_name, spec_str, relo->kind);
                return -ENOTSUP;