Skip to content

Commit b061950

Browse files
build: support newlines in syscall decls
Some auto formatters will wrap long lines of code and insert newlines that are part of function decls outside of arguments. This change strips out all newlines so syscall typename regex function as expected. Signed-off-by: Mark Inderhees <[email protected]>
1 parent 04d8b7c commit b061950

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/build/gen_syscalls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ class SyscallParseException(Exception):
184184

185185

186186
def typename_split(item):
187+
item = item.strip().replace("\n", " ")
187188
if "[" in item:
188189
raise SyscallParseException(
189190
"Please pass arrays to syscalls as pointers, unable to process '%s'" %
@@ -396,7 +397,7 @@ def analyze_fn(match_group, fn, userspace_only):
396397
if args == "void":
397398
args = []
398399
else:
399-
args = [typename_split(a.strip()) for a in args.split(",")]
400+
args = [typename_split(a) for a in args.split(",")]
400401

401402
func_type, func_name = typename_split(func)
402403
except SyscallParseException:

0 commit comments

Comments
 (0)