[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190625141142.2378-1-ivan.khoronzhuk@linaro.org>
Date: Tue, 25 Jun 2019 17:11:42 +0300
From: Ivan Khoronzhuk <ivan.khoronzhuk@...aro.org>
To: ast@...nel.org, netdev@...r.kernel.org
Cc: daniel@...earbox.net, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org,
Ivan Khoronzhuk <ivan.khoronzhuk@...aro.org>
Subject: [PATCH net-next] tools: lib: bpf: libbpf: fix max() type mistmatch for 32bit
It fixes build error for 32bit coused by type mistmatch
size_t/unsigned long.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@...aro.org>
---
Based on net-next/master
tools/lib/bpf/libbpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 4259c9f0cfe7..d03016a559e2 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -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");
--
2.17.1
Powered by blists - more mailing lists