The patch titled Subject: checkpatch: improve patch recognition has been added to the -mm tree. Its filename is checkpatch-improve-patch-recognition.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/checkpatch-improve-patch-recognition.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-improve-patch-recognition.patch 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 and is updated there every 3-4 working days ------------------------------------------------------ From: Joe Perches <joe@xxxxxxxxxxx> Subject: checkpatch: improve patch recognition There are mode change and rename only patches that are unrecognized by checkpatch. Recognize them. Link: http://lkml.kernel.org/r/974a407e6fa18abd5a965da39cc68986a4c4f091.1526949367.git.joe@xxxxxxxxxxx Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> Reported-by: Heinrich Schuchardt <xypron.glpk@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/checkpatch.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN scripts/checkpatch.pl~checkpatch-improve-patch-recognition scripts/checkpatch.pl --- a/scripts/checkpatch.pl~checkpatch-improve-patch-recognition +++ a/scripts/checkpatch.pl @@ -2375,6 +2375,14 @@ sub process { my $rawline = $rawlines[$linenr - 1]; +# check if it's a mode change, rename or start of a patch + if (!$in_commit_log && + ($line =~ /^ mode change [0-7]+ => [0-7]+ \S+\s*$/ || + ($line =~ /^rename (?:from|to) \S+\s*$/ || + $line =~ /^diff --git a\/[\w\/\.\_\-]+ b\/\S+\s*$/)) { + $is_patch = 1; + } + #extract the line range in the file after the patch is applied if (!$in_commit_log && $line =~ /^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@(.*)/) { _ Patches currently in -mm which might be from joe@xxxxxxxxxxx are checkpatch-fix-macro-argument-precedence-test.patch checkpatch-add-a-strict-test-for-structs-with-bool-member-definitions.patch checkpatch-improve-patch-recognition.patch get_maintainer-improve-patch-recognition.patch mm-use-octal-not-symbolic-permissions.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html