[PATCH 2/4] checkpatch: don't stop at the first non-patch input with --no-patch

From: Bjorn Andersson

Date: Sat Nov 07 2026 - 23:22:35 EST


When checkpatch is given multiple inputs with --no-patch, process()
calls exit(0) as soon as it encounters an input that isn't a patch.
The remaining inputs are never checked, and the run is reported as
successful even if later inputs contain errors or warnings.

E.g. with a non-patch file followed by a patch with a bogus Fixes: tag:

$ ./scripts/checkpatch.pl -q --terse --no-patch notes.txt bad.patch
$ echo $?
0

Return from process() instead, so the non-patch input is still
silently skipped while the remaining inputs are checked.

Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxxxxxxxx>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e84bb4c12eb4..45279c17f70a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -7886,7 +7886,7 @@ sub process {
# This is not a patch, and we are in 'no-patch' mode so
# just keep quiet.
if (!$chk_patch && !$is_patch) {
- exit(0);
+ return 1;
}

if (!$is_patch && $filename !~ /cover-letter\.patch$/) {

--
2.55.0