selftests: add ksft_exit_fail_perror()
authorMuhammad Usama Anjum <usama.anjum@collabora.com>
Thu, 4 Apr 2024 16:14:32 +0000 (21:14 +0500)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 6 May 2024 19:57:19 +0000 (13:57 -0600)
commit86483f8b4e8d3eb364bfa9049b46fea3578af050
tree52e9ad2ee79565662789093b4e2383159c2e510e
parentb4970a8c50c4a8310e907d25abbce5094564633b
selftests: add ksft_exit_fail_perror()

Add a version of ksft_exit_fail_msg() which prints the errno and its
string form with ease. There is no benefit of exit message without
errno. Whenever some error occurs, instead of printing errno manually,
this function would be very helpful. In the next TAP ports or new tests,
this function will be used instead of ksft_exit_fail_msg() as it prints
errno.

Resolved merge conflict found in next between the following commits:
f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn")

f07041728422 ("selftests: add ksft_exit_fail_perror()")

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/kselftest.h