Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp603565ybd; Wed, 26 Jun 2019 03:40:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpfyTn09VaCblzBFSwRLDH82V8xSHgw7CNHa0T/Mo2Py3UyQ34C5n560vYz6VM09UTw2+n X-Received: by 2002:a63:ed13:: with SMTP id d19mr2313600pgi.100.1561545651427; Wed, 26 Jun 2019 03:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561545651; cv=none; d=google.com; s=arc-20160816; b=nr0ULtmTWD5wXCXc3bEy2x6v0x0T1WHqbJrLfIljEwiW1vQy3aJpNjBHnhUlVQeBAo +OWZfpYBnXrZMYVd0AZ16XXL1cqRjfA8g9f4SY8XA0jlH8BtMuajhRmcVpKYedumW9Tx rv53TKGtGV2CM3QZXKSoPrNU95zS7l3Pl0nlQQYcqyRBPKmUzdfMUtYYYyolXgC07KnA NHcr8TUws352+v0E8yBB2i+Bo4sqis8aF5Znjj6feFDufTJVr70z2iuZ5d95NoBh7Amr 1Rny9pAjct7nXuucZxuwal03Gr13PLuUJhRVH1VZw9eFpaTxGZGQFHmwNSNQ9EYNjZKl jlwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=7/7ThqJsHZEC1k6/iKremUj3hn4/MicnKE4/aT1gNsA=; b=bXeEORZQ/tuuTs6w0at2NRSWJbiAPnpWjrbZ9iXdoIloMzFQYDxOL2+tfJ1dqOgyc/ tVSfSOobxNn4rSpGexeDiO3Hx4W4aFcfA8Sa4adm2AYTUEC5oKy02HEpi6F8geph+qMK ke8liACqNWAa3ov0HmIPfCHb0hOybC4bz+LK6z44Vkpu6OjCc95+2JAeJBVgHvM51M3I LMK3GuWGZnuTiUrTB8eMoxrPb+E7fIWm4Yduw34dMRmn7FeWJ//K9ijxw7/vtzHGkuVX Ps17hWlKRlhn1NKqa7rpU4COsEc8TYsqqfBstC8tXoD4RdlHqex0cTEp73CU9YwEZvDc Bpvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jwIaGN1W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a94si1678168pje.19.2019.06.26.03.40.34; Wed, 26 Jun 2019 03:40:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jwIaGN1W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727259AbfFZKim (ORCPT + 99 others); Wed, 26 Jun 2019 06:38:42 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:44239 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726864AbfFZKim (ORCPT ); Wed, 26 Jun 2019 06:38:42 -0400 Received: by mail-lj1-f194.google.com with SMTP id k18so828236ljc.11 for ; Wed, 26 Jun 2019 03:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=7/7ThqJsHZEC1k6/iKremUj3hn4/MicnKE4/aT1gNsA=; b=jwIaGN1WLQvvoZpKTt5omB84aC8rELXROrOqHTju1pFE/gX3muJ+LvqaoL8c2seXb/ vegxwJh3qQD8GK50OyLjQOu4/kkWbzlPkvEQmLBZU1Y+eEDjNKsIg785Ld/Q/ONf4sN3 yyzJWMZeOqe9JKH+t76WHopIaSweZ6sJuNq8vZNPeuFnKkIEHPKDBzeDMqr6jOjw2R3Y FXs5yQ9UdU463EB3n5hJFH/Kke6R6KK38+DFpNJ/MJU1ArsCYdYXorNDBP3poUP/o/HH AlNFR7BbFfgyAgaEETNNRA5/ED9Yaz58fYEQrH7M4E1uSFr3HUdDV9nV+ynJy/cYsPxX x40g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7/7ThqJsHZEC1k6/iKremUj3hn4/MicnKE4/aT1gNsA=; b=XH8+f6SVysVLWLHKfBD+cMbErCQmGjA6BpW51jy91rTgbA3K+FEc2QFIUMaLDtt1ZQ WeCP44qTy+FUaE0Wef21/G/cXJiPePkPvMic7gl1TFz5CE6+WpjLzutVfCr40xa4im0Y 31UoRABv5X2fuY2sI4lj0NYHFuLgmJ6sIY4SRRAmExhw/J+hUZ2znpqIRlUFkgO/crXy bYXhFr6TtVYVfYEM4e4TyASk66z7+XGkIPJ/YRcgk4VQKNDmeCvIXGYvjSN2obznNtCA hDatz8fka4FqnFsoEVuhmB7NU5QgQTo2KLL5c/Xrzd5DFBhOWlZPEzhC2pvpTtCFzHSu 5hqg== X-Gm-Message-State: APjAAAXzcBdCCxqzuP0YH2Y/UZDtNRyXTo9jpEKVnJB297i1QWvp1jVO TvXJ12zHf7xCJB2NEFCAnG8xug== X-Received: by 2002:a2e:730d:: with SMTP id o13mr2317536ljc.81.1561545520323; Wed, 26 Jun 2019 03:38:40 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id 80sm2372230lfz.56.2019.06.26.03.38.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 03:38:39 -0700 (PDT) From: Ivan Khoronzhuk To: ast@kernel.org, netdev@vger.kernel.org Cc: daniel@iogearbox.net, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH v2 bpf-next] libbpf: fix max() type mismatch for 32bit Date: Wed, 26 Jun 2019 13:38:37 +0300 Message-Id: <20190626103837.6455-1-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It fixes build error for 32bit caused by type mismatch size_t/unsigned long. Fixes: bf82927125dd ("libbpf: refactor map initialization") Acked-by: Song Liu Acked-by: Andrii Nakryiko Signed-off-by: Ivan Khoronzhuk --- 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 68f45a96769f..5186b7710430 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