mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Subject: [PATCH 1/4] checkpatch: don't stop at the first clean patch with --mailback
Date: Sun, 08 Nov 2026 04:21:02 +0000	[thread overview]
Message-ID: <20261108-checkpatch-fixes-hash-v1-1-d49b3085c20b@oss.qualcomm.com> (raw)
In-Reply-To: <20261108-checkpatch-fixes-hash-v1-0-d49b3085c20b@oss.qualcomm.com>

When checkpatch is given multiple patches, either as several files or
as a --git range, --mailback causes process() to call exit(0) as soon
as it encounters a clean patch. The remaining patches are never
checked, and the run is reported as successful even if later patches
contain errors or warnings.

E.g. with a clean patch followed by a patch with a bogus Fixes: tag:

  $ ./scripts/checkpatch.pl -q --terse --mailback clean.patch bad.patch
  $ echo $?
  0

Return from process() instead, so the clean patch is still silently
accepted while the remaining patches are checked.

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

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 741b189d5e01..e84bb4c12eb4 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -7880,7 +7880,7 @@ sub process {
 	# In mailback mode only produce a report in the negative, for
 	# things that appear to be patches.
 	if ($mailback && ($clean == 1 || !$is_patch)) {
-		exit(0);
+		return 1;
 	}
 
 	# This is not a patch, and we are in 'no-patch' mode so

-- 
2.55.0


  reply	other threads:[~2026-11-08  4:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08  4:21 [PATCH 0/4] checkpatch: improve exit criterias Bjorn Andersson
2026-11-08  4:21 ` Bjorn Andersson [this message]
2026-11-08  4:21 ` [PATCH 2/4] checkpatch: don't stop at the first non-patch input with --no-patch Bjorn Andersson
2026-11-08  4:21 ` [PATCH 3/4] checkpatch: don't stop at the first empty input Bjorn Andersson
2026-11-08  4:21 ` [PATCH 4/4] checkpatch: fail on missing or unreadable files with --file Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261108-checkpatch-fixes-hash-v1-1-d49b3085c20b@oss.qualcomm.com \
    --to=bjorn.andersson@oss.qualcomm.com \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®