diff mbox series

[1/1] checkpatch: Pass git root

Message ID 20260513134948.77923-1-pvorel@suse.cz
State Accepted
Headers show
Series [1/1] checkpatch: Pass git root | expand

Checks

Context Check Description
ltpci/github-build-debian_stable_powerpc64le-linux-gnu-gcc_ppc64el success success
ltpci/github-build-doc success success
ltpci/github-build-debian_stable_aarch64-linux-gnu-gcc_arm64 success success
ltpci/github-build-debian_testing_gcc success success
ltpci/github-build-ubuntu_noble_gcc success success
ltpci/github-build-opensuse-leap_latest_gcc success success
ltpci/github-build-debian_stable_s390x-linux-gnu-gcc_s390x success success
ltpci/github-build-alpine_latest_gcc success success
ltpci/github-build-debian_oldstable_gcc success success
ltpci/github-build-debian_testing_clang success success
ltpci/github-build-fedora_latest_clang success success
ltpci/github-build-debian_oldstable_clang success success
ltpci/github-build-opensuse-archive_42-2_gcc success success
ltpci/github-build-debian_stable_gcc success success
ltpci/github-build-ubuntu_jammy_gcc success success
ltpci/github-build-debian_stable_gcc success success
ltpci/github-build-quay-io-centos-centos_stream9_gcc success success
ltpci/copilot-review success Approved

Commit Message

Petr Vorel May 13, 2026, 1:49 p.m. UTC
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(-)

Comments

linuxtestproject.agent@gmail.com May 13, 2026, 4:22 p.m. UTC | #1
Hi Petr,

On Wed, 13 May 2026, Petr Vorel wrote:
> checkpatch: Pass git root

> -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)

Note: there is a double space between `-f` and `--root`; consider collapsing
to a single space for consistency.

Reviewed-by: LTP AI Reviewer <ltp-ai@noreply.github.com>

---
Note:

Our agent completed the review of the patch.

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer
Andrea Cervesato May 19, 2026, 8:56 a.m. UTC | #2
Hi Petr,

> Hi Petr,
> 
> On Wed, 13 May 2026, Petr Vorel wrote:
> > checkpatch: Pass git root
> 
> > -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)
> 
> Note: there is a double space between `-f` and `--root`; consider collapsing
> to a single space for consistency.
> 

Can you please fix this before merging the patch?
Otherwise LGTM

Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
Petr Vorel May 27, 2026, 7:37 a.m. UTC | #3
Hi Andrea,

> Hi Petr,

> > Hi Petr,

> > On Wed, 13 May 2026, Petr Vorel wrote:
> > > checkpatch: Pass git root

> > > -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)

The original patch is:

-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)

https://lists.linux.it/pipermail/ltp/2026-May/048397.html
https://lore.kernel.org/ltp/20260513134948.77923-1-pvorel@suse.cz/
https://patchwork.ozlabs.org/project/ltp/patch/20260513134948.77923-1-pvorel@suse.cz/

> > Note: there is a double space between `-f` and `--root`; consider collapsing
> > to a single space for consistency.


> Can you please fix this before merging the patch?

This is really funny. Interesting variant of hallucination. AI just added space
and pointed it out as my error.

Anyway, patch merged, no modification was needed. Thanks for your review.

Kind regards,
Petr
diff mbox series

Patch

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))))