Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1028364pxj; Fri, 4 Jun 2021 04:27:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu4ZRCGn+IcXOg3l6fqaUHKDVbpWi2waDXbWysL3p11i3oZg6n8/Ruxa2EkftC3h5HHEdt X-Received: by 2002:a05:6402:3488:: with SMTP id v8mr4266727edc.124.1622806077040; Fri, 04 Jun 2021 04:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622806077; cv=none; d=google.com; s=arc-20160816; b=grzdSV0PPtwRGgY+VXFFCzpnRKJ+w2UEpfUj7GOxi21X190m0BRLcwfP+pt0E9fh+k qCbIOZtcyytfFf4Kqi/0ZvF/QjKqP3JUC6R4zbufKUbk3HPAD0V3N1VBI8Chh0GkU1YM z7Joxtm0p6kdCeEYmO9dLwfgjoKEgq8kdawhdAc3NgFC3akweJAyZItmg8SCxNsPXhdT R4lvloAbGi/h89o7Nv0aUaa9rwwPdjUiYHhOzbVqm5MFswfUNichFnk4i7FnVK8Ao8ag hVdwjhM5XnPA7cVxbgeulWcVRl29tdMik15W7mX3yWwT5J7MdZsIwUQ6Rp3pj0P+SnV3 r31A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=KvwB2iX6N3U8dsxrAx26cUnRKNUIXsfqg7dJXyh1/xw=; b=s7y0HFcG4cR1Trjt22d34oq8k9fBbX92mx1nH3ob9Zlyx1NfjVV5T5nUjxQ+w7zTMf d7u/dwkdGdhCiVsvWKWYniSH9JN9j40dqaHQbc2mWGebJwVBRthJqQGflikUaAOIldkn fev8fCB55oMLRjmpdlM7G+RVFKS49IC7QwtUk9fTXbZipIQDbBVMG+9q4Urq9iXI6Bo+ lbM/0OrHUKmYfDkV3C2RkC3tOhISxXVYChPLqOK5mZSnFdZR/TXoIMCQMxARhMJyP/0u juIltzHS6z30x2t35WagsyG1w7eO6dmwzzdFNoSytDBhFZfCmwjHpTxlBw2FjhUj+p+S Lpgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="Elr/q18V"; dkim=neutral (no key) header.i=@suse.de header.b=hRjuEO3z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr23si4471542ejb.468.2021.06.04.04.27.32; Fri, 04 Jun 2021 04:27:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="Elr/q18V"; dkim=neutral (no key) header.i=@suse.de header.b=hRjuEO3z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230033AbhFDL0i (ORCPT + 99 others); Fri, 4 Jun 2021 07:26:38 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:50314 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbhFDL0h (ORCPT ); Fri, 4 Jun 2021 07:26:37 -0400 Received: from relay2.suse.de (unknown [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id D49701FD4A; Fri, 4 Jun 2021 11:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622805890; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KvwB2iX6N3U8dsxrAx26cUnRKNUIXsfqg7dJXyh1/xw=; b=Elr/q18VQyxMG3puKM9hQ+T3j1ary++HsU/d7mhZKuxqIFQghvq5v3+F99PdaG4V5A+iZh wV9wiZXLHH1zuNsDghOGMjTGoZADJn3Gf127cr7aYOMmKfjYfgKNaT8rnGaE5nETiKJkso LKS0JB/cF9sQSHvTYbZDtgAPtuuFhqk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622805890; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KvwB2iX6N3U8dsxrAx26cUnRKNUIXsfqg7dJXyh1/xw=; b=hRjuEO3z/fNzEImuCtuiEspWJS/eNAtsrn+T27rb5r1F/u9dmAvmpN/Xhn/2s26CZd/3jv x7lEfGpRASQRRuDA== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) by relay2.suse.de (Postfix) with ESMTP id 98516A3B85; Fri, 4 Jun 2021 11:24:50 +0000 (UTC) From: Michal Suchanek To: bpf@vger.kernel.org Cc: Michal Suchanek , Networking , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Nathan Chancellor , Nick Desaulniers , open list , clang-built-linux Subject: [PATCH bpf-next] libbpf: fix pr_warn type warnings on 32bit Date: Fri, 4 Jun 2021 13:24:48 +0200 Message-Id: <20210604112448.32297-1-msuchanek@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The printed value is ptrdiff_t and is formatted wiht %ld. This works on 64bit but produces a warning on 32bit. Fix the format specifier to %td. Fixes: 67234743736a ("libbpf: Generate loader program out of BPF ELF file.") Signed-off-by: Michal Suchanek --- tools/lib/bpf/libbpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index ef6600688f10..5e13c9d8d3f5 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -4584,7 +4584,7 @@ static int init_map_slots(struct bpf_object *obj, struct bpf_map *map) targ_map = map->init_slots[i]; fd = bpf_map__fd(targ_map); if (obj->gen_loader) { - pr_warn("// TODO map_update_elem: idx %ld key %d value==map_idx %ld\n", + pr_warn("// TODO map_update_elem: idx %td key %d value==map_idx %td\n", map - obj->maps, i, targ_map - obj->maps); return -ENOTSUP; } else { @@ -6208,7 +6208,7 @@ static int bpf_core_apply_relo(struct bpf_program *prog, return -EINVAL; if (prog->obj->gen_loader) { - pr_warn("// TODO core_relo: prog %ld insn[%d] %s %s kind %d\n", + pr_warn("// TODO core_relo: prog %td insn[%d] %s %s kind %d\n", prog - prog->obj->programs, relo->insn_off / 8, local_name, spec_str, relo->kind); return -ENOTSUP; -- 2.26.2