aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-09-09 18:37:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-10 16:29:01 -0400
commit7d3a9f673e1bdb45f86d15a67e230e4a9b050850 (patch)
treea4893fb6092cc84ca97eebb4ef12249b22ab37d1 /scripts/checkpatch.pl
parent100425deeb7586c9d401f787aeab3b43a4c6a0c6 (diff)
checkpatch: report the right line # when using --emacs and --file
commit 34d8815f9512 ("checkpatch: add --showfile to allow input via pipe to show filenames") broke the --emacs with --file option. Fix it. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 780c91d82aa9..ea28336ea2a5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2166,7 +2166,11 @@ sub process {
2166 if ($showfile) { 2166 if ($showfile) {
2167 $prefix = "$realfile:$realline: " 2167 $prefix = "$realfile:$realline: "
2168 } elsif ($emacs) { 2168 } elsif ($emacs) {
2169 $prefix = "$filename:$linenr: "; 2169 if ($file) {
2170 $prefix = "$filename:$realline: ";
2171 } else {
2172 $prefix = "$filename:$linenr: ";
2173 }
2170 } 2174 }
2171 2175
2172 if ($found_file) { 2176 if ($found_file) {