Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] build: run make check on test sources in kernel module directories
@ 2026-06-10 13:00 Andrea Cervesato
  2026-06-10 13:25 ` [LTP] " linuxtestproject.agent
  2026-06-15 12:36 ` [LTP] [PATCH] " Cyril Hrubis
  0 siblings, 2 replies; 4+ messages in thread
From: Andrea Cervesato @ 2026-06-10 13:00 UTC (permalink / raw)
  To: Linux Test Project

From: Andrea Cervesato <andrea.cervesato@suse.com>

In directories that build a kernel module, module.mk set CHECK_TARGETS
with ':=' before env_post.mk could populate it via '?=', leaving it empty
so 'make check' never ran sparse/checkpatch on the test sources. The filter
also used a '%.ko' pattern that never matched any 'check-<name>' entry.

Drop the broken assignment from module.mk and instead exclude the kernel
module sources (MODULE_SOURCES) in env_post.mk once CHECK_TARGETS has been
populated, so test sources are checked while kernel module code is skipped.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 include/mk/env_post.mk | 2 +-
 include/mk/module.mk   | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/mk/env_post.mk b/include/mk/env_post.mk
index 726b9a9e7526562f4f6e8363da394485c805fa88..43983197638a2ba42a9c1a20e072fa3179e04344 100644
--- a/include/mk/env_post.mk
+++ b/include/mk/env_post.mk
@@ -70,7 +70,7 @@ endif # END $(filter-out install,$(MAKECMDGOALS)),$(MAKECMDGOALS)
 endif
 
 CHECK_TARGETS			?= $(addprefix check-,$(notdir $(patsubst %.c,%,$(sort $(wildcard $(abs_srcdir)/*.c)))))
-CHECK_TARGETS			:= $(filter-out $(addprefix check-, $(FILTER_OUT_MAKE_TARGETS)), $(CHECK_TARGETS))
+CHECK_TARGETS			:= $(filter-out $(addprefix check-, $(FILTER_OUT_MAKE_TARGETS) $(notdir $(basename $(MODULE_SOURCES)))), $(CHECK_TARGETS))
 CHECK_HEADER_TARGETS		?= $(addprefix check-,$(notdir $(sort $(wildcard $(abs_srcdir)/*.h))))
 CHECK				?= $(abs_top_srcdir)/tools/sparse/sparse-ltp
 CHECK_NOFLAGS			?= CHECKPATCH_CONFIG_DIR="$(abs_top_srcdir)" $(abs_top_srcdir)/scripts/checkpatch.pl -f --root $(abs_top_srcdir)
diff --git a/include/mk/module.mk b/include/mk/module.mk
index 3e97f01289e2eb4f5a494c55a83022860b37a835..8949d9067ca6afdb790de122ff4ff56e38a54066 100644
--- a/include/mk/module.mk
+++ b/include/mk/module.mk
@@ -51,8 +51,6 @@ endif
 
 CLEAN_TARGETS += .dep_modules *.mod built-in.a
 
-CHECK_TARGETS := $(filter-out %.ko, $(CHECK_TARGETS))
-
 MODULE_SOURCES := $(patsubst %.ko,%.c,$(filter %.ko, $(MAKE_TARGETS)))
 
 # Ignoring the exit status of commands is done to be forward compatible with

---
base-commit: c1b71bf7ebb6a58507e4998faf5c74154f595f96
change-id: 20260610-fix_buildsystem_modules-a5df16c4fdae

Best regards,
-- 
Andrea Cervesato <andrea.cervesato@suse.com>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2026-06-15 12:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-10 13:00 [LTP] [PATCH] build: run make check on test sources in kernel module directories Andrea Cervesato
2026-06-10 13:25 ` [LTP] " linuxtestproject.agent
2026-06-15 12:36 ` [LTP] [PATCH] " Cyril Hrubis
2026-06-15 12:44   ` Andrea Cervesato via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox