linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, Martin Lau <kafai@fb.com>,
	Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
	john fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>, Bill Wendling <morbo@google.com>,
	Shuah Khan <shuah@kernel.org>, bpf <bpf@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 bpf-next 2/3] libbpf: fix compilation errors on ppc64le for btf dump typed data
Date: Fri, 16 Jul 2021 17:32:51 -0700	[thread overview]
Message-ID: <CAEf4BzavQqexc_5DM0vh89ocjp0dvSMrLU4P4hTfmwt9rTsv4Q@mail.gmail.com> (raw)
In-Reply-To: <1626475617-25984-3-git-send-email-alan.maguire@oracle.com>

On Fri, Jul 16, 2021 at 3:47 PM Alan Maguire <alan.maguire@oracle.com> wrote:
>
> Andrii reports:
>
> "ppc64le arch doesn't like the %lld:
>
>  In file included from btf_dump.c:22:
> btf_dump.c: In function 'btf_dump_type_data_check_overflow':
> libbpf_internal.h:111:22: error: format '%lld' expects argument of
> type 'long long int', but argument 3 has type '__s64' {aka 'long int'}
> [-Werror=format=]
>   111 |  libbpf_print(level, "libbpf: " fmt, ##__VA_ARGS__); \
>       |                      ^~~~~~~~~~
> libbpf_internal.h:114:27: note: in expansion of macro '__pr'
>   114 | #define pr_warn(fmt, ...) __pr(LIBBPF_WARN, fmt, ##__VA_ARGS__)
>       |                           ^~~~
> btf_dump.c:1992:3: note: in expansion of macro 'pr_warn'
>  1992 |   pr_warn("unexpected size [%lld] for id [%u]\n",
>       |   ^~~~~~~
> btf_dump.c:1992:32: note: format string is defined here
>  1992 |   pr_warn("unexpected size [%lld] for id [%u]\n",
>       |                             ~~~^
>       |                                |
>       |                                long long int
>       |                             %ld
>
> Cast to size_t and use %zu."
>

Quoting me isn't a great commit message by itself, tbh. Reworded.



> Reported-by: Andrii Nakryiko <andrii@kernel.org>
> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
> ---
>  tools/lib/bpf/btf_dump.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c
> index 814a538..e5fbfb8 100644
> --- a/tools/lib/bpf/btf_dump.c
> +++ b/tools/lib/bpf/btf_dump.c
> @@ -2011,8 +2011,8 @@ static int btf_dump_type_data_check_overflow(struct btf_dump *d,
>         __s64 size = btf__resolve_size(d->btf, id);
>
>         if (size < 0 || size >= INT_MAX) {
> -               pr_warn("unexpected size [%lld] for id [%u]\n",
> -                       size, id);
> +               pr_warn("unexpected size [%zu] for id [%u]\n",
> +                       (size_t)size, id);
>                 return -EINVAL;
>         }
>
> --
> 1.8.3.1
>

  reply	other threads:[~2021-07-17  0:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 22:46 [PATCH v2 bpf-next 0/3] libbpf: BTF typed dump cleanups Alan Maguire
2021-07-16 22:46 ` [PATCH v2 bpf-next 1/3] libbpf: clarify/fix unaligned data issues for btf typed dump Alan Maguire
2021-07-17  0:32   ` Andrii Nakryiko
2021-07-16 22:46 ` [PATCH v2 bpf-next 2/3] libbpf: fix compilation errors on ppc64le for btf dump typed data Alan Maguire
2021-07-17  0:32   ` Andrii Nakryiko [this message]
2021-07-16 22:46 ` [PATCH v2 bpf-next 3/3] libbpf: btf typed dump does not need to allocate dump data Alan Maguire
2021-07-17  0:32   ` Andrii Nakryiko
2021-07-17  0:32 ` [PATCH v2 bpf-next 0/3] libbpf: BTF typed dump cleanups Andrii Nakryiko
2021-07-17  0:38   ` Andrii Nakryiko

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=CAEf4BzavQqexc_5DM0vh89ocjp0dvSMrLU4P4hTfmwt9rTsv4Q@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=morbo@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).