]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
livepatch/klp-build: Introduce fix-patch-lines script to avoid __LINE__ diff noise
authorJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 17 Sep 2025 16:04:06 +0000 (09:04 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 14 Oct 2025 21:50:19 +0000 (14:50 -0700)
commitabaf1f42ddd070662fb419aed29c985ea209bd88
tree730fabd85602e9a9b75693498190274685b1e642
parentf2c356d1d0f048e88c281a4178c8b2db138d3ac1
livepatch/klp-build: Introduce fix-patch-lines script to avoid __LINE__ diff noise

The __LINE__ macro creates challenges for binary diffing.  When a .patch
file adds or removes lines, it shifts the line numbers for all code
below it.

This can cause the code generation of functions using __LINE__ to change
due to the line number constant being embedded in a MOV instruction,
despite there being no semantic difference.

Avoid such false positives by adding a fix-patch-lines script which can
be used to insert a #line directive in each patch hunk affecting the
line numbering.  This script will be used by klp-build, which will be
introduced in a subsequent patch.

Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
MAINTAINERS
scripts/livepatch/fix-patch-lines [new file with mode: 0755]