[PATCH V2 21/26] tools/perf/arch/x86: Fix syscalltbl.sh to address shellcheck warnings

Athira Rajeev atrajeev at linux.vnet.ibm.com
Mon Jul 10 04:27:55 AEST 2023


Running shellcheck on syscalltbl.sh generates below warning:

   In ./tools/perf/arch/x86/entry/syscalls/syscalltbl.sh line 27:
   while read nr abi name entry compat; do
                 ^-^ SC2034 (warning): abi appears unused. Verify use (or export if used externally).
                                ^----^ SC2034 (warning): compat appears unused. Verify use (or export if used externally).

These variables are intentioanlly unused since they
are needed to parse through the output. Use "_" as a
prefix for these throw away variables.

Signed-off-by: Athira Rajeev <atrajeev at linux.vnet.ibm.com>
---
 tools/perf/arch/x86/entry/syscalls/syscalltbl.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh b/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh
index fa526a993845..59d7914ed6bb 100755
--- a/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh
+++ b/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh
@@ -24,7 +24,7 @@ sorted_table=$(mktemp /tmp/syscalltbl.XXXXXX)
 grep '^[0-9]' "$in" | sort -n > $sorted_table
 
 max_nr=0
-while read nr abi name entry compat; do
+while read nr _abi name entry _compat; do
     if [ $nr -ge 512 ] ; then # discard compat sycalls
         break
     fi
-- 
2.39.1



More information about the Linuxppc-dev mailing list