bpftool: Fix -Wcast-qual warning
authorDenys Zagorui <dzagorui@cisco.com>
Thu, 7 Sep 2023 09:02:10 +0000 (02:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jan 2024 16:16:54 +0000 (17:16 +0100)
commit0b39339f8afa7549125323072a1a29a237ca5c29
tree1d124a03b8107e59141e6434ec25fedcad6424ae
parent030346df8cc417edbf8f8d77d152a95368480fb8
bpftool: Fix -Wcast-qual warning

[ Upstream commit ebc8484d0e6da9e6c9e8cfa1f40bf94e9c6fc512 ]

This cast was made by purpose for older libbpf where the
bpf_object_skeleton field is void * instead of const void *
to eliminate a warning (as i understand
-Wincompatible-pointer-types-discards-qualifiers) but this
cast introduces another warning (-Wcast-qual) for libbpf
where data field is const void *

It makes sense for bpftool to be in sync with libbpf from
kernel sources

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20230907090210.968612-1-dzagorui@cisco.com
Stable-dep-of: 23671f4dfd10 ("bpftool: Align output skeleton ELF code")
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/bpf/bpftool/gen.c