[PATCH V2 1/3] tools/perf/tests Ignore the shellcheck SC2046 warning in lock_contention
Athira Rajeev
atrajeev at linux.vnet.ibm.com
Fri Oct 13 18:30:19 AEDT 2023
Running shellcheck on lock_contention.sh generates below
warning
In tests/shell/lock_contention.sh line 36:
if [ `nproc` -lt 4 ]; then
^-----^ SC2046: Quote this to prevent word splitting.
Here since nproc will generate a single word output
and there is no possibility of word splitting, this
warning can be ignored. Use exception for this with
"disable" option in shellcheck. This warning is observed
after commit:
"commit 29441ab3a30a ("perf test lock_contention.sh: Skip test
if not enough CPUs")"
Fixes: 29441ab3a30a ("perf test lock_contention.sh: Skip test if not enough CPUs")
Signed-off-by: Athira Rajeev <atrajeev at linux.vnet.ibm.com>
Reviewed-by: Kajol Jain <kjain at linux.ibm.com>
---
changelog:
v1 -> v2:
Add Reviewed-by from Kajol Jain
tools/perf/tests/shell/lock_contention.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/tests/shell/lock_contention.sh b/tools/perf/tests/shell/lock_contention.sh
index d5a191d3d090..c1ec5762215b 100755
--- a/tools/perf/tests/shell/lock_contention.sh
+++ b/tools/perf/tests/shell/lock_contention.sh
@@ -33,6 +33,7 @@ check() {
exit
fi
+ # shellcheck disable=SC2046
if [ `nproc` -lt 4 ]; then
echo "[Skip] Low number of CPUs (`nproc`), lock event cannot be triggered certainly"
err=2
--
2.31.1
More information about the Linuxppc-dev
mailing list