linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] checkpatch.pl Is "does MAINTAINERS need updating" check broken?
@ 2020-11-19 15:52 Andersen, John
  0 siblings, 0 replies; 2+ messages in thread
From: Andersen, John @ 2020-11-19 15:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andy Whitcroft, Joe Perches

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) {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC] checkpatch.pl Is "does MAINTAINERS need updating" check broken?
       [not found] <20201119040123.GA629660@johnsa1-desk.jf.intel.com>
@ 2020-11-19  4:00 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2020-11-19  4:00 UTC (permalink / raw)
  To: Andersen, John; +Cc: LKML

On Wed, 2020-11-18 at 20:01 -0800, Andersen, John wrote:
> I just noticed that patches which have "added, moved or deleted file(s)" and
> updated MAINTAINERS still trigger the following warning:

Please to not directly message me.
Send any questions to the lkml list and cc me.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-19 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 15:52 [RFC] checkpatch.pl Is "does MAINTAINERS need updating" check broken? Andersen, John
     [not found] <20201119040123.GA629660@johnsa1-desk.jf.intel.com>
2020-11-19  4:00 ` Joe Perches

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).