The checkpatch.pl script insists that Fixes tags are at the start of each line of its input. Although this is where they ought to be in the commit message, it is not where the script will see them in common usage patterns like
git show <hash> | ./scripts/checkpatch.pl - because 'git show' prefaces each line of the commit message body with four spaces. Allow spaces before the Fixes tag; this matches how we check for e.g. Signed-off-by: tags. Reported-by: Stefano Garzarella <[email protected]> Fixes: 910e1d41be6b2 ("scripts/checkpatch: validate Fixes: tag format and commit ancestry") Signed-off-by: Peter Maydell <[email protected]> --- I just ran into this myself today as well so wrote up the patch --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5df266acb17..82f62f60212 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1889,7 +1889,7 @@ sub process { if ($line !~ /^\s*Fixes:\s+CVE/i) { my $tag_case = not ($tag eq "Fixes:"); - my $tag_space = not ($line =~ /^fixes:? [0-9a-f]{5,40}/i); + my $tag_space = not ($line =~ /^\s*fixes:? [0-9a-f]{5,40}/i); my $id_length = not ($orig_commit =~ /^[0-9a-f]{12,40}$/); my $id_case = not ($orig_commit !~ /[A-F]/); -- 2.43.0
