drbd/0003-build-compat-fix-line-offset-in-annotation-pragmas-p.patch
2025-01-08 07:34:16 +00:00

37 lines
1.5 KiB
Diff

From d6f2b71109f6a589fbc3d5c571c840a6bd142943 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars.ellenberg@linbit.com>
Date: Thu, 22 Aug 2024 16:05:25 +0200
Subject: [PATCH 03/32] build,compat: fix line offset in annotation pragmas
pointing to patched sources
I forgot to update the "new position" by the two output pragma lines
for each non-context to context line transition per chunk.
Offsets would accumultate within the chunk, but reset with the next chunk.
Pragmas pointing into the "patched" file would be off by two lines
(per such transition within a chunk), pointing to some line 2 (4,6,8) lines
above the actual offending line.
Noticed during recent compat work when the backward compat cocci rules
where still incomplete.
---
.../annotate-diff-with-original-file-position-pragmas.pl | 1 +
1 file changed, 1 insertion(+)
diff --git a/drbd/drbd-kernel-compat/annotate-diff-with-original-file-position-pragmas.pl b/drbd/drbd-kernel-compat/annotate-diff-with-original-file-position-pragmas.pl
index c28265e6dd9d..de95689a6ef0 100644
--- a/drbd/drbd-kernel-compat/annotate-diff-with-original-file-position-pragmas.pl
+++ b/drbd/drbd-kernel-compat/annotate-diff-with-original-file-position-pragmas.pl
@@ -91,6 +91,7 @@ m{^--- (?:\./)?(\S+)$} and do {
$chunk .= qq{+# $. "$patch_name"\n};
$chunk .= qq{+# $o_pos "$ABS_NAME"\n};
$n_count += 2;
+ $n_pos += 2;
$extra_ncount += 2;
$file_line_context_points_to_orig = 1;
$state = ' ';
--
2.35.3