From: Jiri Olsa <olsajiri@gmail.com>
To: Liwei Song <liwei.song.lsong@gmail.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com,
song@kernel.org, yonghong.song@linux.dev,
john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me,
haoluo@google.com, vmalik@redhat.com, alan.maguire@oracle.com,
friedrich.vock@gmx.de, dxu@dxuuu.xyz,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/resolve_btfids: fix comparison of distinct pointer types warning in resolve_btfids
Date: Mon, 22 Jul 2024 10:53:06 +0200 [thread overview]
Message-ID: <Zp4d8mAt0RYtTAuc@krava> (raw)
In-Reply-To: <20240722083305.4009723-1-liwei.song.lsong@gmail.com>
On Mon, Jul 22, 2024 at 04:32:59PM +0800, Liwei Song wrote:
> Add a type cast for set8->pairs to fix below compile warning:
>
> main.c: In function 'sets_patch':
> main.c:699:50: warning: comparison of distinct pointer types lacks a cast
> 699 | BUILD_BUG_ON(set8->pairs != &set8->pairs[0].id);
> | ^~
>
> Fixes: 9707ac4fe2f5 ("tools/resolve_btfids: Refactor set sorting with types from btf_ids.h")
> Signed-off-by: Liwei Song <liwei.song.lsong@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
jirka
> ---
> tools/bpf/resolve_btfids/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c
> index af393c7dee1f..b3edc239fe56 100644
> --- a/tools/bpf/resolve_btfids/main.c
> +++ b/tools/bpf/resolve_btfids/main.c
> @@ -696,7 +696,7 @@ static int sets_patch(struct object *obj)
> * Make sure id is at the beginning of the pairs
> * struct, otherwise the below qsort would not work.
> */
> - BUILD_BUG_ON(set8->pairs != &set8->pairs[0].id);
> + BUILD_BUG_ON((u32 *)set8->pairs != &set8->pairs[0].id);
> qsort(set8->pairs, set8->cnt, sizeof(set8->pairs[0]), cmp_id);
>
> /*
> --
> 1.8.3.1
>
next prev parent reply other threads:[~2024-07-22 8:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-22 8:32 [PATCH] tools/resolve_btfids: fix comparison of distinct pointer types warning in resolve_btfids Liwei Song
2024-07-22 8:53 ` Jiri Olsa [this message]
2024-07-22 8:57 ` bot+bpf-ci
2024-07-22 14: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=Zp4d8mAt0RYtTAuc@krava \
--to=olsajiri@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=dxu@dxuuu.xyz \
--cc=eddyz87@gmail.com \
--cc=friedrich.vock@gmx.de \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liwei.song.lsong@gmail.com \
--cc=martin.lau@linux.dev \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=vmalik@redhat.com \
--cc=yonghong.song@linux.dev \
/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.