From 91b61239322f5d4acdf7c0459ce85180366fc821 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Tue, 11 Sep 2018 18:05:14 -0700 Subject: [PATCH] kernel: syscall: Explicitly ignoring not used return Some syscacll return value through parameters and for these functions the return of _arch_syscall_invoke* are not used. MISRA requires that all return values be checked. Signed-off-by: Flavio Ceolin --- include/syscall.h | 6 +++--- scripts/gen_syscall_header.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/syscall.h b/include/syscall.h index e78dc83f333..8a24cdbe463 100644 --- a/include/syscall.h +++ b/include/syscall.h @@ -249,7 +249,7 @@ static inline u64_t _syscall_ret64_invoke0(u32_t call_id) { u64_t ret; - _arch_syscall_invoke1((u32_t)&ret, call_id); + (void)_arch_syscall_invoke1((u32_t)&ret, call_id); return ret; } @@ -257,7 +257,7 @@ static inline u64_t _syscall_ret64_invoke1(u32_t arg1, u32_t call_id) { u64_t ret; - _arch_syscall_invoke2(arg1, (u32_t)&ret, call_id); + (void)_arch_syscall_invoke2(arg1, (u32_t)&ret, call_id); return ret; } @@ -266,7 +266,7 @@ static inline u64_t _syscall_ret64_invoke2(u32_t arg1, u32_t arg2, { u64_t ret; - _arch_syscall_invoke3(arg1, arg2, (u32_t)&ret, call_id); + (void)_arch_syscall_invoke3(arg1, arg2, (u32_t)&ret, call_id); return ret; } diff --git a/scripts/gen_syscall_header.py b/scripts/gen_syscall_header.py index f4a66ddfaf5..1305096a325 100755 --- a/scripts/gen_syscall_header.py +++ b/scripts/gen_syscall_header.py @@ -74,6 +74,8 @@ def gen_make_syscall(ret, argc, tabcount): tabs(tabcount) if (ret != Retval.VOID): sys.stdout.write("return (ret)") + else: + sys.stdout.write("return (void)") if (argc <= 6 and ret != Retval.U64): sys.stdout.write("_arch") sys.stdout.write("_syscall%s_invoke%d(" %