[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zp4d8mAt0RYtTAuc@krava>
Date: Mon, 22 Jul 2024 10:53:06 +0200
From: Jiri Olsa <olsajiri@...il.com>
To: Liwei Song <liwei.song.lsong@...il.com>
Cc: bpf@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, martin.lau@...ux.dev, eddyz87@...il.com,
song@...nel.org, yonghong.song@...ux.dev, john.fastabend@...il.com,
kpsingh@...nel.org, sdf@...ichev.me, haoluo@...gle.com,
vmalik@...hat.com, alan.maguire@...cle.com, friedrich.vock@....de,
dxu@...uu.xyz, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tools/resolve_btfids: fix comparison of distinct pointer
types warning in resolve_btfids
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@...il.com>
Acked-by: Jiri Olsa <jolsa@...nel.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
>
Powered by blists - more mailing lists