[tip: objtool/core] livepatch/klp-build: fix shellcheck complaints

From: tip-bot2 for Joe Lawrence

Date: Wed Mar 18 2026 - 04:26:28 EST


The following commit has been merged into the objtool/core branch of tip:

Commit-ID: b4a53519393521c68ec65f43bfebd64f178e6220
Gitweb: https://git.kernel.org/tip/b4a53519393521c68ec65f43bfebd64f178e6220
Author: Joe Lawrence <joe.lawrence@xxxxxxxxxx>
AuthorDate: Tue, 10 Mar 2026 16:37:46 -04:00
Committer: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
CommitterDate: Mon, 16 Mar 2026 12:46:49 -07:00

livepatch/klp-build: fix shellcheck complaints

Fix or suppress the following shellcheck warnings:

In klp-build line 57:
command grep "$@" || true
^--^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).

Fix the following warning:

In klp-build line 565:
local file_dir="$(dirname "$file")"
^------^ SC2034 (warning): file_dir appears unused. Verify use (or export if used externally).

Acked-by: Song Liu <song@xxxxxxxxxx>
Signed-off-by: Joe Lawrence <joe.lawrence@xxxxxxxxxx>
Link: https://patch.msgid.link/20260310203751.1479229-8-joe.lawrence@xxxxxxxxxx
Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
---
scripts/livepatch/klp-build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build
index cf6c2bf..374e126 100755
--- a/scripts/livepatch/klp-build
+++ b/scripts/livepatch/klp-build
@@ -53,6 +53,7 @@ PATCH_TMP_DIR="$TMP_DIR/tmp"
KLP_DIFF_LOG="$DIFF_DIR/diff.log"

grep0() {
+ # shellcheck disable=SC2317
command grep "$@" || true
}

@@ -550,7 +551,6 @@ copy_orig_objects() {
for _file in "${files[@]}"; do
local rel_file="${_file/.ko/.o}"
local file="$OBJ/$rel_file"
- local file_dir="$(dirname "$file")"
local orig_file="$ORIG_DIR/$rel_file"
local orig_dir="$(dirname "$orig_file")"