[LTP] [PATCH 12/13] mem/hugetlb: Remove mem/lib depenency

Cyril Hrubis
2024-12-18T18:49:15Z

The last bit used from the library PATH_SHMMAX macro.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/mem/hugetlb/Makefile.inc | 3 ---
testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c | 1 -
testcases/kernel/mem/hugetlb/lib/Makefile | 1 -
testcases/kernel/mem/hugetlb/lib/hugetlb.h | 3 ++-
4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/mem/hugetlb/Makefile.inc b/testcases/kernel/mem/hugetlb/Makefile.inc
index 9a4aa8795..b272e62a8 100644
--- a/testcases/kernel/mem/hugetlb/Makefile.inc
+++ b/testcases/kernel/mem/hugetlb/Makefile.inc
@@ -33,6 +33,3 @@ CPPFLAGS += -I$(abs_srcdir)/$(LIBIPCDIR)
LDFLAGS += -L$(abs_builddir)/$(LIBIPCDIR)
LDLIBS += -lhugetlb
MAKE_DEPS += $(LIBIPC)
-
-include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk
-# vim: syntax=make
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c
index d5983fc55..75f28102d 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c
@@ -34,7 +34,6 @@ static char path_sys_sz_huge[BUFSIZ];
#define PATH_PROC_VM "/proc/sys/vm/"
#define PATH_PROC_OVER PATH_PROC_VM "nr_overcommit_hugepages"
#define PATH_PROC_HUGE PATH_PROC_VM "nr_hugepages"
-#define PATH_SHMMAX "/proc/sys/kernel/shmmax"

/* Only ia64 requires this */
#ifdef __ia64__
diff --git a/testcases/kernel/mem/hugetlb/lib/Makefile b/testcases/kernel/mem/hugetlb/lib/Makefile
index ceccd2615..45606b17f 100644
--- a/testcases/kernel/mem/hugetlb/lib/Makefile
+++ b/testcases/kernel/mem/hugetlb/lib/Makefile
@@ -4,7 +4,6 @@
top_srcdir ?= ../../../../..

include $(top_srcdir)/include/mk/env_pre.mk
-include $(top_srcdir)/testcases/kernel/mem/include/libmem.mk

INTERNAL_LIB := libhugetlb.a

diff --git a/testcases/kernel/mem/hugetlb/lib/hugetlb.h b/testcases/kernel/mem/hugetlb/lib/hugetlb.h
index abc88e25e..22975c99a 100644
--- a/testcases/kernel/mem/hugetlb/lib/hugetlb.h
+++ b/testcases/kernel/mem/hugetlb/lib/hugetlb.h
@@ -17,7 +17,6 @@
#include <errno.h>
#include <sys/wait.h>
#include "tst_test.h"
-#include "mem.h"

#define PALIGN(p, a) ((void *)LTP_ALIGN((unsigned long)(p), (a)))

@@ -29,6 +28,8 @@
#define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
#endif

+#define PATH_SHMMAX "/proc/sys/kernel/shmmax"
+
#ifndef barrier
# ifdef mb
/* Redefining the mb() */
--
2.45.2