[PATCH v9 13/15] syscalls: Avoid matching substrings in the ABI parsing

André Almeida andrealmeid at igalia.com
Thu Nov 5 12:05:48 PST 2026


Currently, the abi parsing for grep will match substrings. For instance, an
ABI called `abc` will match also the ABI called `abcde`. Use the space
limiter to match a complete word and avoid matching substrings.

While here, add a true command in the end of grep command to avoid the
script exiting earlier and being able to do the cleanup.

Signed-off-by: André Almeida <andrealmeid at igalia.com>
---
 scripts/syscallhdr.sh | 2 +-
 scripts/syscalltbl.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/syscallhdr.sh b/scripts/syscallhdr.sh
index cf6bba3019b1..cf35ff05b824 100755
--- a/scripts/syscallhdr.sh
+++ b/scripts/syscallhdr.sh
@@ -109,7 +109,7 @@ gen_hdr() {
 	tmpfile=$(mktemp)
 	offset_nr=$2
 
-	grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$input" > $tmpfile
+	grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis+[[:space:]]" "$input" > $tmpfile || true
 	while read nr abi name native compat; do
 
 		if [ -n "$offset_nr" ]; then
diff --git a/scripts/syscalltbl.sh b/scripts/syscalltbl.sh
index 1e9cac32c02d..403a604e7c76 100755
--- a/scripts/syscalltbl.sh
+++ b/scripts/syscalltbl.sh
@@ -70,7 +70,7 @@ gen_tbl() {
 	tmpfile=$(mktemp)
 	offset_nr=$2
 
-	grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$input" > $tmpfile
+	grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis+[[:space:]]" "$input" > $tmpfile || true
 	while read nr abi name native compat noreturn; do
 
                 if [ -n "$offset_nr" ]; then

-- 
2.56.0




More information about the linux-arm-kernel mailing list