From: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
To: akpm@linux-foundation.org, shuah@kernel.org
Cc: mic@digikod.net, gnoack@google.com, david@redhat.com,
lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
mhocko@suse.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
ming.lei@redhat.com, skhan@linuxfoundation.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-mm@kvack.org,
Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
Subject: [PATCH 1/2] selftests: Centralize include path for kselftest.h and kselftest_harness.h
Date: Wed, 27 Aug 2025 20:17:32 +0530 [thread overview]
Message-ID: <20250827144733.82277-2-reddybalavignesh9979@gmail.com> (raw)
In-Reply-To: <20250827144733.82277-1-reddybalavignesh9979@gmail.com>
Add compile flag in Makefile and export it in lib.mk
Also add CFLAGS in sync/Makefile's rules to fix include path
error for kselftest.h.
Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
---
tools/testing/selftests/Makefile | 4 ++++
tools/testing/selftests/lib.mk | 2 ++
2 files changed, 6 insertions(+)
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 030da61dbff3..7c9db82a81e6 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -194,11 +194,15 @@ else
DEFAULT_INSTALL_HDR_PATH := 1
endif
+# Include path for kselftest.h
+KSFT_INCLUDES := -I${abs_srctree}/tools/testing/selftests
+
# Prepare for headers install
include $(top_srcdir)/scripts/subarch.include
ARCH ?= $(SUBARCH)
export BUILD
export KHDR_INCLUDES
+export KSFT_INCLUDES
# set default goal to all, so make without a target runs all, even when
# all isn't the first target in the file.
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 530390033929..50289b9a1e1d 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -199,6 +199,8 @@ clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir)
# Build with _GNU_SOURCE by default
CFLAGS += -D_GNU_SOURCE=
+CFLAGS += $(KSFT_INCLUDES)
+
# Enables to extend CFLAGS and LDFLAGS from command line, e.g.
# make USERCFLAGS=-Werror USERLDFLAGS=-static
CFLAGS += $(USERCFLAGS)
--
2.43.0
next prev parent reply other threads:[~2025-08-27 14:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-27 14:47 [PATCH 0/2] selftests: Centralize kselftest headers to avoid relative includes Bala-Vignesh-Reddy
2025-08-27 14:47 ` Bala-Vignesh-Reddy [this message]
2025-08-27 14:47 ` [PATCH 2/2] selftests: Replace relative includes with non-relative for kselftest.h and kselftest_harness.h Bala-Vignesh-Reddy
2025-08-28 8:10 ` Wei Yang
2025-08-28 9:40 ` Bala-Vignesh-Reddy
2025-08-29 1:43 ` Wei Yang
2025-08-29 10:53 ` Bala-Vignesh-Reddy
2025-08-30 0:55 ` Wei Yang
2025-08-27 22:56 ` [PATCH 0/2] selftests: Centralize kselftest headers to avoid relative includes Andrew Morton
2025-08-30 16:39 ` [PATCH v2 " Bala-Vignesh-Reddy
2025-08-30 16:39 ` [PATCH v2 1/2] selftests: Centralize include path for kselftest.h and kselftest_harness.h Bala-Vignesh-Reddy
2025-08-30 22:30 ` Wei Yang
2025-08-30 16:39 ` [PATCH v2 2/2] selftests: Replace relative includes with non-relative " Bala-Vignesh-Reddy
2025-08-30 22:31 ` Wei Yang
2025-08-31 20:03 ` Andrew Morton
2025-09-01 2:58 ` Bala-Vignesh-Reddy
2025-10-16 10:44 ` [PATCH v3] selftests: complete kselftest include centralization Bala-Vignesh-Reddy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250827144733.82277-2-reddybalavignesh9979@gmail.com \
--to=reddybalavignesh9979@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=david@redhat.com \
--cc=edumazet@google.com \
--cc=gnoack@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-security-module@vger.kernel.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=mic@digikod.net \
--cc=ming.lei@redhat.com \
--cc=pabeni@redhat.com \
--cc=rppt@kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox