From 9b987dce278a2db2a35a42b73f08be1a29a3bbe6 Mon Sep 17 00:00:00 2001 From: Simon Kuenzer Date: Mon, 15 Feb 2021 16:52:15 +0100 Subject: [PATCH] support: checkpatch: Prefer raw system call definitions Introduces a warning for system call definitions when `UK_SYSCALL_DEFINE` and `UK_LLSYSCALL_DEFINE` was used: Raw system call definitions are preferred because `errno` is not used. Signed-off-by: Simon Kuenzer Reviewed-by: Alexander Jung Tested-by: Unikraft CI GitHub-Pull-Request: #166 --- support/scripts/checkpatch.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/support/scripts/checkpatch.pl b/support/scripts/checkpatch.pl index e73444c3f..804c1214a 100755 --- a/support/scripts/checkpatch.pl +++ b/support/scripts/checkpatch.pl @@ -6370,6 +6370,12 @@ sub process { "unknown module license " . $extracted_string . "\n" . $herecurr); } } + +# check for UK_(LL)SYSCALL_DEFINE(), raw implementation should be preferred + if ($line =~ /\bUK_(LL)?SYSCALL_DEFINE\s*\(/) { + WARN("NON_RAW_SYSCALL", + "Prefer using raw system call definitions: 'UK_SYSCALL_R_DEFINE', 'UK_LLSYSCALL_R_DEFINE'\n" . $herecurr); + } } # If we have no input at all, then there is nothing to report on -- 2.39.5