All of lore.kernel.org
 help / color / mirror / Atom feed
* + checkpatch-fix-bad-file_path_changes-on-headers.patch added to mm-nonmm-unstable branch
@ 2026-11-09  5:51 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-11-09  5:51 UTC (permalink / raw)
  To: mm-commits, joe, apw, ptosi, akpm

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2959 bytes --]


The patch titled
     Subject: checkpatch: fix bad FILE_PATH_CHANGES on headers
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     checkpatch-fix-bad-file_path_changes-on-headers.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/checkpatch-fix-bad-file_path_changes-on-headers.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Pierre-Clément Tosi <ptosi@google.com>
Subject: checkpatch: fix bad FILE_PATH_CHANGES on headers
Date: Sat, 07 Nov 2026 16:02:36 +0100

The FILE_PATH_CHANGES warning ("added, moved or deleted file(s), does
MAINTAINERS need updating?") added by commit 13f1937ef339 ("checkpatch:
emit a warning on file add/move/delete") was guarded by !$in_commit_log so
that commit message lines would not be mistaken for diffstat or diff
header lines.

However, it was still evaluated on the initial email header lines
($in_header_lines == 1) such that a title using the rename notation e.g.

    Subject: [PATCH] foo: rework bar_{get=>set}_baz()

triggers a false-positive warning. Furthermore, that same (wrong) code
path sets $is_patch prematurely.

Instead, only test for FILE_PATH_CHANGES when !$in_header_lines.

Link: https://lore.kernel.org/20261107-checkpatch-file_path_changes-v1-1-8b11814560d8@google.com
Fixes: 13f1937ef339 ("checkpatch: emit a warning on file add/move/delete")
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
---

 scripts/checkpatch.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/scripts/checkpatch.pl~checkpatch-fix-bad-file_path_changes-on-headers
+++ a/scripts/checkpatch.pl
@@ -3486,7 +3486,7 @@ sub process {
 		}
 
 # Check for added, moved or deleted files
-		if (!$reported_maintainer_file && !$in_commit_log &&
+		if (!$reported_maintainer_file && !$in_commit_log && !$in_header_lines &&
 		    ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
 		     $line =~ /^rename (?:from|to) [\w\/\.\-]+\s*$/ ||
 		     ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ &&
_

Patches currently in -mm which might be from ptosi@google.com are

checkpatch-fix-bad-file_path_changes-on-headers.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-09  5:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-09  5:51 + checkpatch-fix-bad-file_path_changes-on-headers.patch added to mm-nonmm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.