Skip to content

Commit 48ca624

Browse files
fomichevborkmann
authored andcommitted
selftests/bpf: Properly initialize linfo in sockmap_basic
When using -Werror=missing-braces, compiler complains about missing braces. Let's use use ={} initialization which should do the job: tools/testing/selftests/bpf/prog_tests/sockmap_basic.c: In function 'test_sockmap_iter': tools/testing/selftests/bpf/prog_tests/sockmap_basic.c:181:8: error: missing braces around initializer [-Werror=missing-braces] union bpf_iter_link_info linfo = {0}; ^ tools/testing/selftests/bpf/prog_tests/sockmap_basic.c:181:8: error: (near initialization for 'linfo.map') [-Werror=missing-braces] tools/testing/selftests/bpf/prog_tests/sockmap_basic.c: At top level: Signed-off-by: Stanislav Fomichev <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent cffcdbf commit 48ca624

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/bpf/prog_tests/sockmap_basic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static void test_sockmap_copy(enum bpf_map_type map_type)
198198
{
199199
DECLARE_LIBBPF_OPTS(bpf_iter_attach_opts, opts);
200200
int err, len, src_fd, iter_fd, duration = 0;
201-
union bpf_iter_link_info linfo = {0};
201+
union bpf_iter_link_info linfo = {};
202202
__u32 i, num_sockets, num_elems;
203203
struct bpf_iter_sockmap *skel;
204204
__s64 *sock_fd = NULL;

0 commit comments

Comments
 (0)