bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf] selftests/bpf: fix trampoline_count.c selftest compilation warning
@ 2020-02-02  6:51 Andrii Nakryiko
  2020-02-02 16:50 ` Yonghong Song
  2020-02-03 23:11 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2020-02-02  6:51 UTC (permalink / raw)
  To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko

Fix missing braces compilation warning in trampoline_count test:

  .../prog_tests/trampoline_count.c: In function ‘test_trampoline_count’:
  .../prog_tests/trampoline_count.c:49:9: warning: missing braces around initializer [-Wmissing-braces]
  struct inst inst[MAX_TRAMP_PROGS] = { 0 };
         ^
  .../prog_tests/trampoline_count.c:49:9: warning: (near initialization for ‘inst[0]’) [-Wmissing-braces]

Fixes: d633d57902a5 ("selftest/bpf: Add test for allowed trampolines count")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
 tools/testing/selftests/bpf/prog_tests/trampoline_count.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/trampoline_count.c b/tools/testing/selftests/bpf/prog_tests/trampoline_count.c
index 1235f3d1cc50..1f6ccdaed1ac 100644
--- a/tools/testing/selftests/bpf/prog_tests/trampoline_count.c
+++ b/tools/testing/selftests/bpf/prog_tests/trampoline_count.c
@@ -46,7 +46,7 @@ void test_trampoline_count(void)
 	const char *fentry_name = "fentry/__set_task_comm";
 	const char *fexit_name = "fexit/__set_task_comm";
 	const char *object = "test_trampoline_count.o";
-	struct inst inst[MAX_TRAMP_PROGS] = { 0 };
+	struct inst inst[MAX_TRAMP_PROGS] = {};
 	int err, i = 0, duration = 0;
 	struct bpf_object *obj;
 	struct bpf_link *link;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf] selftests/bpf: fix trampoline_count.c selftest compilation warning
  2020-02-02  6:51 [PATCH bpf] selftests/bpf: fix trampoline_count.c selftest compilation warning Andrii Nakryiko
@ 2020-02-02 16:50 ` Yonghong Song
  2020-02-03 23:11 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2020-02-02 16:50 UTC (permalink / raw)
  To: Andrii Nakryiko, bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team



On 2/1/20 10:51 PM, Andrii Nakryiko wrote:
> Fix missing braces compilation warning in trampoline_count test:
> 
>    .../prog_tests/trampoline_count.c: In function ‘test_trampoline_count’:
>    .../prog_tests/trampoline_count.c:49:9: warning: missing braces around initializer [-Wmissing-braces]
>    struct inst inst[MAX_TRAMP_PROGS] = { 0 };
>           ^
>    .../prog_tests/trampoline_count.c:49:9: warning: (near initialization for ‘inst[0]’) [-Wmissing-braces]
> 
> Fixes: d633d57902a5 ("selftest/bpf: Add test for allowed trampolines count")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Acked-by: Yonghong Song <yhs@fb.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf] selftests/bpf: fix trampoline_count.c selftest compilation warning
  2020-02-02  6:51 [PATCH bpf] selftests/bpf: fix trampoline_count.c selftest compilation warning Andrii Nakryiko
  2020-02-02 16:50 ` Yonghong Song
@ 2020-02-03 23:11 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2020-02-03 23:11 UTC (permalink / raw)
  To: Andrii Nakryiko, bpf, netdev, ast; +Cc: andrii.nakryiko, kernel-team

On 2/2/20 7:51 AM, Andrii Nakryiko wrote:
> Fix missing braces compilation warning in trampoline_count test:
> 
>    .../prog_tests/trampoline_count.c: In function ‘test_trampoline_count’:
>    .../prog_tests/trampoline_count.c:49:9: warning: missing braces around initializer [-Wmissing-braces]
>    struct inst inst[MAX_TRAMP_PROGS] = { 0 };
>           ^
>    .../prog_tests/trampoline_count.c:49:9: warning: (near initialization for ‘inst[0]’) [-Wmissing-braces]
> 
> Fixes: d633d57902a5 ("selftest/bpf: Add test for allowed trampolines count")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-03 23:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-02  6:51 [PATCH bpf] selftests/bpf: fix trampoline_count.c selftest compilation warning Andrii Nakryiko
2020-02-02 16:50 ` Yonghong Song
2020-02-03 23:11 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).