<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 17, 2020 at 10:16 PM Martin Doucha <<a href="mailto:mdoucha@suse.cz">mdoucha@suse.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-off-by: Martin Doucha <<a href="mailto:mdoucha@suse.cz" target="_blank">mdoucha@suse.cz</a>><br>
---<br>
<br>
Changes since v1: This patch was split off from the v1 BPF fix. Code cleanup<br>
to prevent future bugs and make the common code more readable.<br>
<br>
Changes since v2: None.<br>
<br>
testcases/kernel/syscalls/bpf/Makefile | 3 ++<br>
testcases/kernel/syscalls/bpf/bpf_common.c | 45 ++++++++++++++++++++++<br>
testcases/kernel/syscalls/bpf/bpf_common.h | 39 ++-----------------<br>
3 files changed, 51 insertions(+), 36 deletions(-)<br>
create mode 100644 testcases/kernel/syscalls/bpf/bpf_common.c<br>
<br>
diff --git a/testcases/kernel/syscalls/bpf/Makefile b/testcases/kernel/syscalls/bpf/Makefile<br>
index 990c8c83c..2241bce9b 100644<br>
--- a/testcases/kernel/syscalls/bpf/Makefile<br>
+++ b/testcases/kernel/syscalls/bpf/Makefile<br>
@@ -5,6 +5,9 @@ top_srcdir ?= ../../../..<br>
<br>
include $(top_srcdir)/include/mk/<a href="http://testcases.mk" rel="noreferrer" target="_blank">testcases.mk</a><br>
<br>
+FILTER_OUT_MAKE_TARGETS := bpf_common<br>
CFLAGS += -D_GNU_SOURCE<br>
<br>
include $(top_srcdir)/include/mk/<a href="http://generic_leaf_target.mk" rel="noreferrer" target="_blank">generic_leaf_target.mk</a><br>
+<br>
+$(MAKE_TARGETS): %: %.o bpf_common.o<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">May I ask why we need to reserve these *.o binary files in the compiling?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"># ls</div>bpf_common.c bpf_common.o bpf_map01.c bpf_prog01 bpf_prog01.o bpf_prog02.c bpf_prog03 bpf_prog03.o<br>bpf_common.h bpf_map01 bpf_map01.o bpf_prog01.c bpf_prog02 bpf_prog02.o bpf_prog03.c Makefile<br><div class="gmail_default" style="font-size:small"><br></div><br></div><div><div class="gmail_default" style="font-size:small">Otherwise, the patchset looks good.</div><div class="gmail_default" style="font-size:small"> Acked-by: Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>></div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>