From patchwork Wed Jun 26 10:38:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 167797 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp770963ilk; Wed, 26 Jun 2019 03:38:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXk9Q77asLtM94IyPBeHA4mtvWuneJpeoJsyvFmZFLma9arPvCs6OawMeuxpncYvuNrBmi X-Received: by 2002:a17:902:30a3:: with SMTP id v32mr4726710plb.6.1561545524300; Wed, 26 Jun 2019 03:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561545524; cv=none; d=google.com; s=arc-20160816; b=J9P3/X7wuWe33DXC/i5/f/bsSLqpRF/al0QaUnZ9MiCfXkh+yGdyWKzdkMdjyNyYpC hDvuWMbgAuOq3JApN4ffQY18pQeO8ntzlnrLpS9+PMlSWs1uwnJuLoRI6RZ6a4ZtlBWy CduyscO7YT+lAug3n8w4YjSaUH+EZVV2n+PEU0zyplrDxoY8idTikbAQAl6OjarVjkWs PISshpSRdUsKdhoX+5mRnY3D7D9MYnYVlLN2CHxd7QWcy5E2i2zkA+x3e3z+1UPSgoO7 mUqRVwpIZh8yoELnOBhk3rVG8qv7h0Vd7MjE5RVBqnQjz2Nrva7L2wm3ZhGcEdNW7e+W EyRg== 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 g12si1739368pjs.67.2019.06.26.03.38.43; Wed, 26 Jun 2019 03:38:44 -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 S1727268AbfFZKim (ORCPT + 30 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(-) -- 2.17.1 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");