summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-04-16 12:44:50 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 09:03:58 -0400
commit323b267faff4db5f2424b6c09ab78a272393b69e (patch)
treece7e14a8f0cf95104cbd18f99013c696b1108593 /scripts
parente15f431fe2d53cd4673510736da7d4fa1090e096 (diff)
downloadkernel-323b267faff4db5f2424b6c09ab78a272393b69e.tar.gz
checkpatch: fix --fix use with a patch of multiple files
If a patch touches multiple files, the --fix and --fix-inplace option doesn't keep the proper line count and makes the new patch file not able to be applied via bad offset line numbers when lines are added or deleted by the --fix option. Dunno how that extra backslash snuck in there. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.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.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 561f41ef531f..35aecb3b013c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1690,7 +1690,7 @@ sub fix_inserted_deleted_lines {
foreach my $old_line (@{$linesRef}) {
my $save_line = 1;
my $line = $old_line; #don't modify the array
- if ($line =~ /^(?:\+\+\+\|\-\-\-)\s+\S+/) { #new filename
+ if ($line =~ /^(?:\+\+\+|\-\-\-)\s+\S+/) { #new filename
$delta_offset = 0;
} elsif ($line =~ /^\@\@ -\d+,\d+ \+\d+,\d+ \@\@/) { #new hunk
$range_last_linenr = $new_linenr;