All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Andrii Nakryiko <andrii@kernel.org>, <bpf@vger.kernel.org>,
	<ast@kernel.org>, <daniel@iogearbox.net>
Cc: <kernel-team@fb.com>
Subject: Re: [PATCH bpf-next] libbpf: fix compilation warning due to mismatched printf format
Date: Tue, 8 Feb 2022 23:18:46 -0800	[thread overview]
Message-ID: <00d2caf2-27a8-b46c-060b-dde41477526e@fb.com> (raw)
In-Reply-To: <20220209063909.1268319-1-andrii@kernel.org>



On 2/8/22 10:39 PM, Andrii Nakryiko wrote:
> On ppc64le architecture __s64 is long int and requires %ld. Cast to
> ssize_t and use %zd to avoid architecture-specific specifiers.
> 
> Fixes: 4172843ed4a3 ("libbpf: Fix signedness bug in btf_dump_array_data()")
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>

Acked-by: Yonghong Song <yhs@fb.com>

> ---
>   tools/lib/bpf/btf_dump.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c
> index 55aed9e398c3..07ebe70d3a30 100644
> --- a/tools/lib/bpf/btf_dump.c
> +++ b/tools/lib/bpf/btf_dump.c
> @@ -1869,7 +1869,8 @@ static int btf_dump_array_data(struct btf_dump *d,
>   	elem_type = skip_mods_and_typedefs(d->btf, elem_type_id, NULL);
>   	elem_size = btf__resolve_size(d->btf, elem_type_id);
>   	if (elem_size <= 0) {
> -		pr_warn("unexpected elem size %lld for array type [%u]\n", elem_size, id);
> +		pr_warn("unexpected elem size %zd for array type [%u]\n",
> +			(ssize_t)elem_size, id);

Does using "%ld" and "(long)elem_size" work?

>   		return -EINVAL;
>   	}
>   

  reply	other threads:[~2022-02-09  7:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09  6:39 [PATCH bpf-next] libbpf: fix compilation warning due to mismatched printf format Andrii Nakryiko
2022-02-09  7:18 ` Yonghong Song [this message]
2022-02-09 13:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00d2caf2-27a8-b46c-060b-dde41477526e@fb.com \
    --to=yhs@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.