Commit 3f374d79 authored by Mark Brown's avatar Mark Brown Committed by Catalin Marinas

kselftest/arm64: Handle more kselftest result codes in MTE helpers

The MTE selftests have a helper evaluate_test() which translates a return
code into a call to ksft_test_result_*(). Currently this only handles pass
and fail, silently ignoring any other code. Update the helper to support
skipped tests and log any unknown return codes as an error so we get at
least some diagnostic if anything goes wrong.
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Reviewed-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20220419103243.24774-2-broonie@kernel.orgSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 82f97bcd
...@@ -75,10 +75,21 @@ unsigned int mte_get_pstate_tco(void); ...@@ -75,10 +75,21 @@ unsigned int mte_get_pstate_tco(void);
/* Test framework static inline functions/macros */ /* Test framework static inline functions/macros */
static inline void evaluate_test(int err, const char *msg) static inline void evaluate_test(int err, const char *msg)
{ {
if (err == KSFT_PASS) switch (err) {
case KSFT_PASS:
ksft_test_result_pass(msg); ksft_test_result_pass(msg);
else if (err == KSFT_FAIL) break;
case KSFT_FAIL:
ksft_test_result_fail(msg); ksft_test_result_fail(msg);
break;
case KSFT_SKIP:
ksft_test_result_skip(msg);
break;
default:
ksft_test_result_error("Unknown return code %d from %s",
err, msg);
break;
}
} }
static inline int check_allocated_memory(void *ptr, size_t size, static inline int check_allocated_memory(void *ptr, size_t size,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment