Skip to content

Commit 759ce73

Browse files
royenheartnamhyung
authored andcommitted
perf build x86: Fix SC2034 error in syscalltbl.sh
Change the unused var in 'arch/x86/entry/syscalls/syscalltbl.sh' to '_' when reading from '$sorted_table'. This change allows the script to pass tests of ShellCheck before and after version 0.7.2 at the same time. When building in arch x86, syscalltbl.sh got a ShellCheck warning, which makes compilation error: In arch/x86/entry/syscalls/syscalltbl.sh line 27: while read nr _abi name entry _compat; do ^-^ SC2034: abi appears unused. Verify use (or export if used externally). ^----^ SC2034: compat appears unused. Verify use (or export if used externally). The script reads unused param abi and compat. It uses format '_xxx' to indicate dummy vars, which won't work properly when ShellCheck <= 0.7.2. According to SC2034, the more general way of writing is to use directly '_' to indicate discarding vars. 'entry' is also replaced by '_' because it just happens to be defined in emit function, otherwise it will lead to some misunderstandings. Link: https://www.shellcheck.net/wiki/SC2034 Signed-off-by: Haoze Xie <[email protected]> Signed-off-by: Yuan Tan <[email protected]> Link: https://lore.kernel.org/r/2143cab4cd8468c88860f4e5e382d0e6b4d89ac9.1720372178.git.royenheart@gmail.com Signed-off-by: Namhyung Kim <[email protected]>
1 parent 6353abd commit 759ce73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/perf/arch/x86/entry/syscalls/syscalltbl.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ sorted_table=$(mktemp /tmp/syscalltbl.XXXXXX)
2424
grep '^[0-9]' "$in" | sort -n > $sorted_table
2525

2626
max_nr=0
27-
while read nr _abi name entry _compat; do
27+
# the params are: nr abi name entry compat
28+
# use _ for intentionally unused variables according to SC2034
29+
while read nr _ name _ _; do
2830
if [ $nr -ge 512 ] ; then # discard compat sycalls
2931
break
3032
fi

0 commit comments

Comments
 (0)