[PATCH 2/4] selftests/mm: Convert some cow error reports to ksft_perror()

Mark Brown posted 4 patches 4 months ago
[PATCH 2/4] selftests/mm: Convert some cow error reports to ksft_perror()
Posted by Mark Brown 4 months ago
This prints the errno and a string decode of it.

Reported-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/mm/cow.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c
index 0adc0ab142c1..ff80329313e4 100644
--- a/tools/testing/selftests/mm/cow.c
+++ b/tools/testing/selftests/mm/cow.c
@@ -332,7 +332,7 @@ static void do_test_vmsplice_in_parent(char *mem, size_t size,
 	if (before_fork) {
 		transferred = vmsplice(fds[1], &iov, 1, 0);
 		if (transferred <= 0) {
-			ksft_print_msg("vmsplice() failed\n");
+			ksft_perror("vmsplice() failed\n");
 			log_test_result(KSFT_FAIL);
 			goto close_pipe;
 		}
@@ -562,7 +562,7 @@ static void do_test_iouring(char *mem, size_t size, bool use_fork)
 	while (total < size) {
 		cur = pread(fd, tmp + total, size - total, total);
 		if (cur < 0) {
-			ksft_print_msg("pread() failed\n");
+			ksft_perror("pread() failed\n");
 			log_test_result(KSFT_FAIL);
 			goto quit_child;
 		}
@@ -628,7 +628,7 @@ static void do_test_ro_pin(char *mem, size_t size, enum ro_pin_test test,
 
 	tmp = malloc(size);
 	if (!tmp) {
-		ksft_print_msg("malloc() failed\n");
+		ksft_perror("malloc() failed\n");
 		log_test_result(KSFT_FAIL);
 		return;
 	}

-- 
2.39.5
Re: [PATCH 2/4] selftests/mm: Convert some cow error reports to ksft_perror()
Posted by David Hildenbrand 4 months ago
On 10.06.25 16:13, Mark Brown wrote:
> This prints the errno and a string decode of it.
> 
> Reported-by: David Hildenbrand <david@redhat.com>

Probably not "Reported-by". Did you mean "Suggested-by" like for the others?

> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb
Re: [PATCH 2/4] selftests/mm: Convert some cow error reports to ksft_perror()
Posted by Mark Brown 4 months ago
On Wed, Jun 11, 2025 at 02:10:20PM +0200, David Hildenbrand wrote:
> On 10.06.25 16:13, Mark Brown wrote:
> > This prints the errno and a string decode of it.
> > 
> > Reported-by: David Hildenbrand <david@redhat.com>
> 
> Probably not "Reported-by". Did you mean "Suggested-by" like for the others?

Probably. I'm sure I was thinking something there but not sure what.