summaryrefslogtreecommitdiff
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorPierre-Clément Tosi <ptosi@google.com>2026-11-07 16:02:36 +0100
committerAndrew Morton <akpm@linux-foundation.org>2026-11-13 00:18:36 -0800
commitf5c2a29d2c9436b983281f608846dca5fa4764ff (patch)
treea572c9268a1d8ad762508a2704af668ef6a14e9c /scripts/checkpatch.pl
parent42eb12a56b2d85b4257d56917dbe7e4f2654e1e8 (diff)
downloadlinux-next-f5c2a29d2c9436b983281f608846dca5fa4764ff.tar.gz
linux-next-f5c2a29d2c9436b983281f608846dca5fa4764ff.zip
checkpatch: fix bad FILE_PATH_CHANGES on headers
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>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index da7d8ae653e5..bd63c4ed647c 100755
--- a/scripts/checkpatch.pl
+++ b/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*\}/ &&