linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Andersen, John" <john.s.andersen@intel.com>
To: linux-kernel@vger.kernel.org
Cc: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Subject: [RFC] checkpatch.pl Is "does MAINTAINERS need updating" check broken?
Date: Thu, 19 Nov 2020 07:52:17 -0800	[thread overview]
Message-ID: <20201119155217.GA631033@johnsa1-desk.jf.intel.com> (raw)

Hi,

I just noticed that patches which have "added, moved or deleted file(s)" and
updated MAINTAINERS still trigger the following warning:

  WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?


Here's two examples using existing patches

$ git show --format=email a7305e684fcfb33029fe3d0af6b7d8dc4c8ca7a1 | ./scripts/checkpatch.pl
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#103:
rename from drivers/power/avs/qcom-cpr.c

total: 0 errors, 1 warnings, 39 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH] PM: AVS: qcom-cpr: Move the driver to the qcom specific" has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

$ git show --format=email bca815d620544c27288abf4841e39922d694425c | ./scripts/checkpatch.pl
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#89:
rename from drivers/power/avs/smartreflex.c

total: 0 errors, 1 warnings, 44 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH] PM: AVS: smartreflex Move driver to soc specific drivers" has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


After applying the patch below it seems that checkpatch now picks up the change
to MAINTAINERS correctly.


$ git show --format=email a7305e684fcfb33029fe3d0af6b7d8dc4c8ca7a1 | ./scripts/checkpatch.pl
total: 0 errors, 0 warnings, 39 lines checked

"[PATCH] PM: AVS: qcom-cpr: Move the driver to the qcom specific" has no obvious style problems and is ready for submission.

$ git show --format=email bca815d620544c27288abf4841e39922d694425c | ./scripts/checkpatch.pl
total: 0 errors, 0 warnings, 44 lines checked

"[PATCH] PM: AVS: smartreflex Move driver to soc specific drivers" has no obvious style problems and is ready for submission.


I am not sure if this is a "doesn't work on my machine" situation or if there is
really an issue here. Please let me know your thoughts.

I didn't do much digging into this but found that simply changing the regex
wasn't enough. I had to put a separate loop above the main loop. I've never
touched pearl so that's they this is such a dumb fix.

Thanks,
John


diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index fab38b493cef..74e27cd64c58 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2510,6 +2510,14 @@ sub process {
 
 	$prefix = '';
 
+# Check if MAINTAINERS is being updated.  If so, there's probably no need to
+# emit the "does MAINTAINERS need updating?" message on file add/move/delete
+	foreach my $line (@lines) {
+		if ($line =~ /\+\+\+ b\/MAINTAINERS$/) {
+			$reported_maintainer_file = 1;
+		}
+	}
+
 	$realcnt = 0;
 	$linenr = 0;
 	$fixlinenr = -1;
@@ -2744,12 +2752,6 @@ sub process {
 			$in_commit_log = 0;
 		}
 
-# Check if MAINTAINERS is being updated.  If so, there's probably no need to
-# emit the "does MAINTAINERS need updating?" message on file add/move/delete
-		if ($line =~ /^\s*MAINTAINERS\s*\|/) {
-			$reported_maintainer_file = 1;
-		}
-
 # Check signature styles
 		if (!$in_header_lines &&
 		    $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) {

             reply	other threads:[~2020-11-19 15:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 15:52 Andersen, John [this message]
     [not found] <20201119040123.GA629660@johnsa1-desk.jf.intel.com>
2020-11-19  4:00 ` [RFC] checkpatch.pl Is "does MAINTAINERS need updating" check broken? Joe Perches

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=20201119155217.GA631033@johnsa1-desk.jf.intel.com \
    --to=john.s.andersen@intel.com \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --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;
as well as URLs for NNTP newsgroup(s).