Re: [PATCH] kbuild: remove srctreie path from CHECK output

From: Nathan Chancellor

Date: Mon Jun 29 2026 - 22:33:22 EST


On Mon, 22 Jun 2026 14:26:53 +0100, Ben Dooks <ben.dooks@xxxxxxxxxxxxxxx> wrote:

Hi Ben,

There is a typo in the subject.

>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 911745743246..d432693e5367 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -159,10 +159,10 @@ targets += $(targets-for-builtin) $(targets-for-modules)
>
> # Linus' kernel sanity checking tool
> ifeq ($(KBUILD_CHECKSRC),1)
> - quiet_cmd_checksrc = CHECK $<
> + quiet_cmd_checksrc = CHECK $(patsubst $(srctree)/%,%,$<)
> cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
> else ifeq ($(KBUILD_CHECKSRC),2)
> - quiet_cmd_force_checksrc = CHECK $<
> + quiet_cmd_force_checksrc = CHECK $(patsubst $(srctree)/%,%,$<)
> cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
> endif
>

I don't have a strong objection to this patch but I know there are
plenty of other places in the build log that will use a full source
path, so this doesn't fully address that inconsistency (and I am not
sure it is inconsistent to begin with, as most build targets are
relative to the build directory whereas files from the source tree have
to be absolute when the build is done outside the tree). But this seems
reasonable enough.

Acked-by: Nathan Chancellor <nathan@xxxxxxxxxx>

--
Cheers,
Nathan