From: Joe Perches Date: Wed, 9 Sep 2015 22:37:39 +0000 (-0700) Subject: checkpatch: report the right line # when using --emacs and --file X-Git-Tag: v4.9.8~3570^2~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d3a9f673e1bdb45f86d15a67e230e4a9b050850;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 780c91d..ea28336 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) {