VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Masahiro Yamada <masahiroy@kernel.org> 2021-07-05 15:06:54 +0900 committer: Masahiro Yamada <masahiroy@kernel.org> 2021-07-09 04:00:39 +0900 commit: c6a3a81d19b834e3aed819027f022c5938fca2ec parent: a0e781a2a35a8dd4e6a38571998d59c6b0e32cd8
Commit Summary:
scripts: check duplicated syscall number in syscall table
Diffstat:
1 file changed, 6 insertions, 1 deletion
diff --git a/scripts/syscalltbl.sh b/scripts/syscalltbl.sh
index aa6ab156301c..6abe143889ef 100755
--- a/scripts/syscalltbl.sh
+++ b/scripts/syscalltbl.sh
@@ -52,10 +52,15 @@ outfile="$2"
 
 nxt=0
 
-grep -E "^[0-9]+[[:space:]]+$abis" "$infile" | sort -n | {
+grep -E "^[0-9]+[[:space:]]+$abis" "$infile" | {
 
 	while read nr abi name native compat ; do
 
+		if [ $nxt -gt $nr ]; then
+			echo "error: $infile: syscall table is not sorted or duplicates the same syscall number" >&2
+			exit 1
+		fi
+
 		while [ $nxt -lt $nr ]; do
 			echo "__SYSCALL($nxt, sys_ni_syscall)"
 			nxt=$((nxt + 1))