aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammad Usama Anjum <[email protected]>2024-04-14 11:26:53 +0500
committerShuah Khan <[email protected]>2024-05-06 13:57:20 -0600
commit557f1375275e04ef92d22aa14203e4b763fbd22b (patch)
tree9fdd682975a8feea1fc3f874cc47bb42619803ab
parent6a5695119e0a8755d907a9a76b08307e41b98fec (diff)
selftests: Mark ksft_exit_fail_perror() as __noreturn
Let the compilers (clang) know that this function would just call exit() and would never return. It is needed to avoid false positive static analysis errors. All similar functions calling exit() unconditionally have been marked as __noreturn. Signed-off-by: Muhammad Usama Anjum <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
-rw-r--r--tools/testing/selftests/kselftest.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index 0a983b27771e..3d2256885cff 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -377,7 +377,7 @@ static inline __noreturn __printf(1, 2) int ksft_exit_fail_msg(const char *msg,
exit(KSFT_FAIL);
}
-static inline void ksft_exit_fail_perror(const char *msg)
+static inline __noreturn void ksft_exit_fail_perror(const char *msg)
{
#ifndef NOLIBC
ksft_exit_fail_msg("%s: %s (%d)\n", msg, strerror(errno), errno);