]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
livepatch/klp-build: fix shellcheck complaints
authorJoe Lawrence <joe.lawrence@redhat.com>
Tue, 10 Mar 2026 20:37:46 +0000 (16:37 -0400)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Mon, 16 Mar 2026 19:46:49 +0000 (12:46 -0700)
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@kernel.org>
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Link: https://patch.msgid.link/20260310203751.1479229-8-joe.lawrence@redhat.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
scripts/livepatch/klp-build

index cf6c2bf694aaea0fb5db8b93016ed50c3704c612..374e1261fd7a031e736035dcf4f324b59ea0035d 100755 (executable)
@@ -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")"