scripts: Fix shellcheck warnings for checkpatch scripts

- Switching from 'set -e' to 'set -euo pipefail' for better error handling.
- Quoting all variable expansions to prevent word splitting and globbing.
- Replacing legacy unquoted $(...) and $@ with quoted forms.
- Using array-safe idioms where necessary (e.g., "${src_files[@]}").

This patch doesn't change any functionality.
This commit is contained in:
Gleb Chesnokov
2025-03-25 17:15:15 +03:00
parent 2e92bd0bb3
commit d09f360b93
4 changed files with 30 additions and 30 deletions

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env bash
set -e
set -euo pipefail
scriptpath=${CHECKPATCH_PATH:-/lib/modules/$(uname -r)/build/scripts}
scriptpath="${CHECKPATCH_PATH:-/lib/modules/$(uname -r)/build/scripts}"
ignore=(
MISSING_SIGN_OFF
@@ -20,6 +20,6 @@ ignore=(
MACRO_ARG_REUSE
IF_0
)
ignore_str=${ignore[*]}
ignore_str="${ignore[*]}"
${scriptpath}/checkpatch.pl --no-tree --show-types --strict --ignore="${ignore_str// /,}" $@
"${scriptpath}/checkpatch.pl" --no-tree --show-types --strict --ignore="${ignore_str// /,}" "$@"