perf tests: Ignore shellcheck warning in lock_contention
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Fri, 13 Oct 2023 07:30:19 +0000 (13:00 +0530)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 17 Oct 2023 19:40:51 +0000 (12:40 -0700)
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@linux.vnet.ibm.com>
Reviewed-by: Kajol Jain <kjain@linux.ibm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: maddy@linux.ibm.com
Cc: disgoel@linux.vnet.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20231013073021.99794-2-atrajeev@linux.vnet.ibm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/tests/shell/lock_contention.sh

index d5a191d3d0906ff0224906a777b236fdd615c5fa..c1ec5762215ba43081fc848243ddf32fe1a82ac0 100755 (executable)
@@ -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