mirror of
https://github.com/torvalds/linux.git
synced 2025-11-10 05:30:50 +02:00
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 intentionally 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@linux.vnet.ibm.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20230709182800.53002-22-atrajeev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
40 lines
639 B
Bash
Executable file
40 lines
639 B
Bash
Executable file
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
in="$1"
|
|
arch="$2"
|
|
|
|
syscall_macro() {
|
|
nr="$1"
|
|
name="$2"
|
|
|
|
echo " [$nr] = \"$name\","
|
|
}
|
|
|
|
emit() {
|
|
nr="$1"
|
|
entry="$2"
|
|
|
|
syscall_macro "$nr" "$entry"
|
|
}
|
|
|
|
echo "static const char *const syscalltbl_${arch}[] = {"
|
|
|
|
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
|
|
if [ $nr -ge 512 ] ; then # discard compat sycalls
|
|
break
|
|
fi
|
|
|
|
emit "$nr" "$name"
|
|
max_nr=$nr
|
|
done < $sorted_table
|
|
|
|
rm -f $sorted_table
|
|
|
|
echo "};"
|
|
|
|
echo "#define SYSCALLTBL_${arch}_MAX_ID ${max_nr}"
|