summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-09-10 00:37:39 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-10 22:29:01 +0200
commit7d3a9f673e1bdb45f86d15a67e230e4a9b050850 (patch)
treea4893fb6092cc84ca97eebb4ef12249b22ab37d1 /scripts
parentcheckpatch: add some <foo>_destroy functions to NEEDLESS_IF tests (diff)
downloadlinux-7d3a9f673e1bdb45f86d15a67e230e4a9b050850.tar.xz
linux-7d3a9f673e1bdb45f86d15a67e230e4a9b050850.zip
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')
-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 {
if ($showfile) {
$prefix = "$realfile:$realline: "
} elsif ($emacs) {
- $prefix = "$filename:$linenr: ";
+ if ($file) {
+ $prefix = "$filename:$realline: ";
+ } else {
+ $prefix = "$filename:$linenr: ";
+ }
}
if ($found_file) {