treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / tools / perf / arch / x86 / entry / syscalls / syscalltbl.sh
blob029a72c20b1970ad94ced82458aa36ea630efd15
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
4 in="$1"
5 arch="$2"
7 syscall_macro() {
8 nr="$1"
9 name="$2"
11 echo " [$nr] = \"$name\","
14 emit() {
15 nr="$1"
16 entry="$2"
18 syscall_macro "$nr" "$entry"
21 echo "static const char *syscalltbl_${arch}[] = {"
23 sorted_table=$(mktemp /tmp/syscalltbl.XXXXXX)
24 grep '^[0-9]' "$in" | sort -n > $sorted_table
26 max_nr=0
27 while read nr abi name entry compat; do
28 if [ $nr -ge 512 ] ; then # discard compat sycalls
29 break
32 emit "$nr" "$name"
33 max_nr=$nr
34 done < $sorted_table
36 rm -f $sorted_table
38 echo "};"
40 echo "#define SYSCALLTBL_${arch}_MAX_ID ${max_nr}"