From patchwork Tue Jun 25 20:27:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 167753 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp6002617ilk; Tue, 25 Jun 2019 13:27:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuFYxFSqg4kQUFulaDVpQBv85EJbX9CC1eSdyVe+du1zqihcXY0W2FcoPl+GmI+Knd5rbk X-Received: by 2002:a63:1d5:: with SMTP id 204mr42051976pgb.207.1561494429625; Tue, 25 Jun 2019 13:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561494429; cv=none; d=google.com; s=arc-20160816; b=ZN/EnZ4XCAhJBZz4RolH3KroNQHr2mu+L56j6BEz6k56Xaru/lA1WahxtS1xqHZk2I 2jdYKcTR7kK++TmoPalsCWGx4rmcXwZLdW8DAdmquojyZD563ZouJLEkvX+r5o79uMOt V0zdPUtNND2RgzthotBRTtLllMe14L1TT2bPpQS1eyV0NGKKnQVfgWWgINLgsnWp4vSG PmRRRnXwKB+W3v836XIa6DUUK5VtGIQVJiRfwb9/GWFQnpUvmWSw7PchFvT5hthZ+Mng aK68BwD4Q//G0sBZ+fSuBY6/q8qQXjy7XLDapLXAnYJCmGCEli8iOWFLB1gf7CKWCeIC JpMQ== 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=0YDqvR98EjwNxyu4huLL3dsPvsKLYn4gdNkZG2oBOJs=; b=NXYoBfRFImP1vdmTWUzvCiVbokeDe+5ige/MazuRlSCMZ9Q7GNV9xK0twZcMM6tEl2 7E9wvToxs1M9PQY/8qUVHDA9gz6eRVmU3hL9sNX4OiZUgwagdpXyp1OhxDOlblFg6+qb TvMqF3JRoeQ+vugoOJZcd1hwlPrn0dKkWhsRAlswY6bHIQmAJuQMQa/znw//TtA5779F E6yOrD3VYG7tXVgBHMvbBZeSs/EzDRQqh5PkOtjHrCEy26tbmLqzbmykKDBNcFWby7cX NxMyrb2HiZncZYyJ6hOpIhgGdWm5Ys0fh2z3sHW2krhc9hm7+eF75iBOTfkb3V6ZvDIK p9wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ogc+rYMA; 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 37si1183224pld.231.2019.06.25.13.27.09; Tue, 25 Jun 2019 13:27:09 -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=ogc+rYMA; 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 S1726776AbfFYU1I (ORCPT + 30 others); Tue, 25 Jun 2019 16:27:08 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:46108 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfFYU1G (ORCPT ); Tue, 25 Jun 2019 16:27:06 -0400 Received: by mail-lf1-f65.google.com with SMTP id z15so13552705lfh.13 for ; Tue, 25 Jun 2019 13:27:05 -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=0YDqvR98EjwNxyu4huLL3dsPvsKLYn4gdNkZG2oBOJs=; b=ogc+rYMA9sdqu9wSpp67RZ+Lj/mZ8Za7GmnoAmifPddTMTPznHlqTWRXxOSIh2hrbf rgHK9WvEXU4z1dSYPcm9UVJ7/GCISvrI1yYKNdeJF5LC6UkAwwCTve6aKweG6zD6g6ab 75bC/zD8yeBlSOGg0GFPTx1lyvDcfhMkwsaCMkvpfgJMLv/p4JnSElcxyzR5NH5Dfrvq WzdTDN89NzXPDXz0CLIQHD0dkAEgaum1ymPsXFsH98xGEcdzZJr41VYDRgig6ZOMYyb/ c3DLt28dh3CpqwUsPcJVVsGBIP87UA8vhN5TtjoScLG+XIIQN8aLoTMCxXD3nR9vBG8w Uicg== 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=0YDqvR98EjwNxyu4huLL3dsPvsKLYn4gdNkZG2oBOJs=; b=kOUzWqtMaLMZ2SqoooYjl5ygu5dMhKbmjJYaDEX6eUOz7Tg4u4UjwTUXH2sGH/mRUX tvysY0ejzp5DS3nNhvQUHiC/azGZdZHeFFhzzF9/0yDP7JM9to5+WxF/AJV0I4gHrcdh lhHfUI4Iaxk/uR7VyQ9ok0nRiRcxsucEcx/GY+jkECcwdtKAcDCph1qAeGi9WwNyIVkG B3klKG18NI1dQ8WON4HcvjaK5Pw/nhFrXg3aejrGYCcSwpOfeYf4WWYrsfY5QJWPgfNt fnMNBXWZJRsLlimFXlh8BBE4xjS5ZXsU4HOK6PQ0zH61SA0eocTI2HPTbe9bzKKWhd08 weaA== X-Gm-Message-State: APjAAAUvxDtWLxYM9aVBcWPta2ylL2Y6iHo1VlDccjJtCgMcXsZmL35X PuAf+pEVhN/FiNff/Al4iHBhmADvNFE= X-Received: by 2002:ac2:5337:: with SMTP id f23mr383567lfh.15.1561494424398; Tue, 25 Jun 2019 13:27:04 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id y10sm2070362lfb.28.2019.06.25.13.27.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 25 Jun 2019 13:27:03 -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 bpf-next] libbpf: fix max() type mismatch for 32bit Date: Tue, 25 Jun 2019 23:27:00 +0300 Message-Id: <20190625202700.28030-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. Signed-off-by: Ivan Khoronzhuk --- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 Acked-by: Song Liu 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");