mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
libbpf: fix max() type mismatch for 32bit
It fixes build error for 32bit caused by type mismatch
size_t/unsigned long.
Fixes: bf82927125 ("libbpf: refactor map initialization")
Acked-by: Song Liu <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Ivan Khoronzhuk <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
This commit is contained in:
parent
9cda7807ee
commit
950649791b
1 changed files with 1 additions and 1 deletions
|
|
@ -778,7 +778,7 @@ static struct bpf_map *bpf_object__add_map(struct bpf_object *obj)
|
|||
if (obj->nr_maps < obj->maps_cap)
|
||||
return &obj->maps[obj->nr_maps++];
|
||||
|
||||
new_cap = max(4ul, obj->maps_cap * 3 / 2);
|
||||
new_cap = max((size_t)4, obj->maps_cap * 3 / 2);
|
||||
new_maps = realloc(obj->maps, new_cap * sizeof(*obj->maps));
|
||||
if (!new_maps) {
|
||||
pr_warning("alloc maps for object failed\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue