Skip to contentSkip to conversation

checkpatch: Fix ignoring cover-letter logic

PATCH Applied Stafford Horne 2 participants 2 messages Sep 9, 2017 – Sep 10, 2017 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: Fix ignoring cover-letter logic

Currently running checkpatch on a directory with a cover-letter.patch file reports the following error:

-----------------------------------------
patches/smp-v2/v2-0000-cover-letter.patch
-----------------------------------------

ERROR: Does not appear to be a unified-diff format patch

The logic to suppress the unified-diff check for cover letters is there but is checking $file instead of $filename. Fix the variable to use the correct one.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index 2287a0bca863..9e46986e06b8 100755
@@ -6365,7 +6365,7 @@ sub process {
 		exit(0);
 	}
 
-	if (!$is_patch && $file !~ /cover-letter\.patch$/) {
+	if (!$is_patch && $filename !~ /cover-letter\.patch$/) {
 		ERROR("NOT_UNIFIED_DIFF",
 		      "Does not appear to be a unified-diff format patch\n");
 	}
Signature · 1 line
2.13.5
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Stafford Horne

Currently running checkpatch on a directory with a cover-letter.patch file reports the following error:

-----------------------------------------
patches/smp-v2/v2-0000-cover-letter.patch
-----------------------------------------

Quoted 7 lines

ERROR: Does not appear to be a unified-diff format patch

The logic to suppress the unified-diff check for cover letters is there but is checking $file instead of $filename. Fix the variable to use the correct one.

scripts/checkpatch.pl

Quoted 1 line
scripts/checkpatch.pl +0 -0

[]

Quoted 9 lines
scripts/checkpatch.pl +1 -1
@@ -6365,7 +6365,7 @@ sub process {
 		exit(0);
 	}
 
-	if (!$is_patch && $file !~ /cover-letter\.patch$/) {
+	if (!$is_patch && $filename !~ /cover-letter\.patch$/) {
 		ERROR("NOT_UNIFIED_DIFF",
 		      "Does not appear to be a unified-diff format patch\n");
 	}