[LTP] [PATCH 1/1] checkpatch: Pass git root
Petr Vorel
pvorel@suse.cz
Wed May 13 15:49:48 CEST 2026
checkpatch.pl --strict parameter added in 1908cd77c2 expects --root
parameter when running with --no-tree due searching in $root/include/
directory.
This fixes warning on files with CAMELCASE check (corner case):
$ cd testcases/kernel/syscalls/statx; make check-statx02
CHECK testcases/kernel/syscalls/statx/statx02.c
Use of uninitialized value $root in concatenation (.) or string at
scripts/checkpatch.pl line 1213.
find: ‘/include’: No such file or directory
statx02.c:52: CHECK: Avoid CamelCase: <PRIu64>
...
Fixes: 1908cd77c2 ("make check: b4: Use --strict when run checkpatch.pl")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
NOTE: I'll verify the usage with kernel checkpatch.pl maintainers.
Kind regards,
Petr
include/mk/env_post.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/mk/env_post.mk b/include/mk/env_post.mk
index 1b0d3a2a8e..726b9a9e75 100644
--- a/include/mk/env_post.mk
+++ b/include/mk/env_post.mk
@@ -73,7 +73,7 @@ CHECK_TARGETS ?= $(addprefix check-,$(notdir $(patsubst %.c,%,$(sort $(wildcar
CHECK_TARGETS := $(filter-out $(addprefix check-, $(FILTER_OUT_MAKE_TARGETS)), $(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
+CHECK_NOFLAGS ?= CHECKPATCH_CONFIG_DIR="$(abs_top_srcdir)" $(abs_top_srcdir)/scripts/checkpatch.pl -f --root $(abs_top_srcdir)
SHELL_CHECK ?= $(abs_top_srcdir)/scripts/checkbashisms.pl --force --extra
SHELL_CHECK_TARGETS ?= $(addprefix check-,$(notdir $(sort $(wildcard $(abs_srcdir)/*.sh))))
--
2.54.0
More information about the ltp
mailing list