qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nabih Estefan <nabihestefan@google.com>
To: qemu-devel@nongnu.org, --save@google.com
Cc: peter.maydell@linaro.org, berrange@redhat.com,
	 Nabih Estefan <nabihestefan@google.com>
Subject: [PATCH] checkpatch: Ignore removed lines in license check
Date: Tue, 16 Sep 2025 16:59:28 +0000	[thread overview]
Message-ID: <20250916165928.10048-1-nabihestefan@google.com> (raw)

When running the license check, if we are updating a license it is
possible for the checkpatch script to test against old license lines
instead of newer ones, since the removal lines appear before the
addition lines in a .patch file.

Fix this by skipping over lines that start with "-" in the checkpatch
script.

Signed-off-by: Nabih Estefan <nabihestefan@google.com>
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 833f20f555..c57a423f9f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1813,7 +1813,8 @@ sub process {
 		}
 
 # Check SPDX-License-Identifier references a permitted license
-		if ($rawline =~ m,SPDX-License-Identifier: (.*?)(\*/)?\s*$,) {
+		if (($rawline =~ m,SPDX-License-Identifier: (.*?)(\*/)?\s*$,) &&
+			$rawline !~ /^-/) {
 			$fileinfo->{facts}->{sawspdx} = 1;
 			&checkspdx($realfile, $1);
 		}
-- 
2.51.0.384.g4c02a37b29-goog



             reply	other threads:[~2025-09-16 17:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16 16:59 Nabih Estefan [this message]
2025-09-17  9:00 ` [PATCH] checkpatch: Ignore removed lines in license check Alex Bennée
2025-09-17  9:24 ` Daniel P. Berrangé
2025-09-17 15:16   ` Nabih Estefan
2025-09-17 16:05     ` Daniel P. Berrangé
2025-09-17 16:17       ` Nabih Estefan
2025-09-17 16:24         ` Daniel P. Berrangé
2025-09-17 16:43 ` Alex Bennée

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=20250916165928.10048-1-nabihestefan@google.com \
    --to=nabihestefan@google.com \
    --cc=--save@google.com \
    --cc=berrange@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).