* [PATCH bpf-next] selftests/bpf: properly initialize linfo in sockmap_basic
@ 2020-10-02 0:04 Stanislav Fomichev
2020-10-02 14:50 ` patchwork-bot+bpf
2020-10-02 15:59 ` John Fastabend
0 siblings, 2 replies; 3+ messages in thread
From: Stanislav Fomichev @ 2020-10-02 0:04 UTC (permalink / raw
To: netdev, bpf; +Cc: davem, ast, daniel, Stanislav Fomichev
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 <sdf@google.com>
---
tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
index 4c4224e3e10a..85f73261fab0 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
@@ -198,7 +198,7 @@ static void test_sockmap_copy(enum bpf_map_type map_type)
{
DECLARE_LIBBPF_OPTS(bpf_iter_attach_opts, opts);
int err, len, src_fd, iter_fd, duration = 0;
- union bpf_iter_link_info linfo = {0};
+ union bpf_iter_link_info linfo = {};
__u32 i, num_sockets, num_elems;
struct bpf_iter_sockmap *skel;
__s64 *sock_fd = NULL;
--
2.28.0.709.gb0816b6eb0-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: properly initialize linfo in sockmap_basic
2020-10-02 0:04 [PATCH bpf-next] selftests/bpf: properly initialize linfo in sockmap_basic Stanislav Fomichev
@ 2020-10-02 14:50 ` patchwork-bot+bpf
2020-10-02 15:59 ` John Fastabend
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bpf @ 2020-10-02 14:50 UTC (permalink / raw
To: Stanislav Fomichev; +Cc: bpf
Hello:
This patch was applied to bpf/bpf-next.git (refs/heads/master):
On Thu, 1 Oct 2020 17:04:51 -0700 you wrote:
> 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:
>
> [...]
Here is the summary with links:
- [bpf-next] selftests/bpf: properly initialize linfo in sockmap_basic
https://git.kernel.org/bpf/bpf-next/c/48ca6243c6ad
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH bpf-next] selftests/bpf: properly initialize linfo in sockmap_basic
2020-10-02 0:04 [PATCH bpf-next] selftests/bpf: properly initialize linfo in sockmap_basic Stanislav Fomichev
2020-10-02 14:50 ` patchwork-bot+bpf
@ 2020-10-02 15:59 ` John Fastabend
1 sibling, 0 replies; 3+ messages in thread
From: John Fastabend @ 2020-10-02 15:59 UTC (permalink / raw
To: Stanislav Fomichev, netdev, bpf; +Cc: davem, ast, daniel, Stanislav Fomichev
Stanislav Fomichev wrote:
> 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 <sdf@google.com>
> ---
Works for me.
Acked-by: John Fastabend <john.fastabend@gmail.com>
> tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
> index 4c4224e3e10a..85f73261fab0 100644
> --- a/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
> +++ b/tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
> @@ -198,7 +198,7 @@ static void test_sockmap_copy(enum bpf_map_type map_type)
> {
> DECLARE_LIBBPF_OPTS(bpf_iter_attach_opts, opts);
> int err, len, src_fd, iter_fd, duration = 0;
> - union bpf_iter_link_info linfo = {0};
> + union bpf_iter_link_info linfo = {};
> __u32 i, num_sockets, num_elems;
> struct bpf_iter_sockmap *skel;
> __s64 *sock_fd = NULL;
> --
> 2.28.0.709.gb0816b6eb0-goog
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-02 15:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-02 0:04 [PATCH bpf-next] selftests/bpf: properly initialize linfo in sockmap_basic Stanislav Fomichev
2020-10-02 14:50 ` patchwork-bot+bpf
2020-10-02 15:59 ` John Fastabend
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.