From 74cf82f9954fafea0288ee9826acf8b740d60285 Mon Sep 17 00:00:00 2001 From: vela-mib Date: Fri, 22 Mar 2024 10:36:55 +0800 Subject: [PATCH] fix build warning for kernel testsuites Signed-off-by: vela-mib --- testing/testsuites/kernel/fs/cases/fs_eventfd_test.c | 2 +- testing/testsuites/kernel/fs/cases/fs_fsync_test.c | 2 +- testing/testsuites/kernel/fs/cases/fs_stream_test.c | 4 ++-- testing/testsuites/kernel/time/cases/clock_test_timer03.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c b/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c index f63402417..583c8c21a 100644 --- a/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c @@ -47,7 +47,7 @@ __attribute__((unused)) static void *thread_func(void *args) eventfd_t eventfd01_buffer; for (int i = 1; i < 6; i++) { - read((int)args, &eventfd01_buffer, sizeof(eventfd_t)); + read(*(int *)args, &eventfd01_buffer, sizeof(eventfd_t)); sleep(1); } diff --git a/testing/testsuites/kernel/fs/cases/fs_fsync_test.c b/testing/testsuites/kernel/fs/cases/fs_fsync_test.c index 00d77fdf9..d212d02da 100644 --- a/testing/testsuites/kernel/fs/cases/fs_fsync_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_fsync_test.c @@ -117,7 +117,7 @@ void test_nuttx_fs_fsync02(FAR void **state) bufsize = statfsbuf.f_bsize; - syslog(LOG_INFO, "the bsize = %d\n", statfsbuf.f_bsize); + syslog(LOG_INFO, "the bsize = %ld\n", statfsbuf.f_bsize); /* malloc memory */ diff --git a/testing/testsuites/kernel/fs/cases/fs_stream_test.c b/testing/testsuites/kernel/fs/cases/fs_stream_test.c index 79e6fbe6d..27d43ef85 100644 --- a/testing/testsuites/kernel/fs/cases/fs_stream_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_stream_test.c @@ -267,7 +267,7 @@ void test_nuttx_fs_stream03(FAR void **state) if ((size_t)ret != len) { syslog(LOG_ERR, - "len = %zi != return value from fwrite = %zi", + "len = %zi != return value from fwrite = %i", len, ret); fclose(stream); assert_true(1 == 0); @@ -300,7 +300,7 @@ void test_nuttx_fs_stream03(FAR void **state) if ((size_t)ret != len) { syslog(LOG_ERR, - "len = %zi != return value from fread = %zi", + "len = %zi != return value from fread = %i", len, ret); free(inbuf); fclose(stream); diff --git a/testing/testsuites/kernel/time/cases/clock_test_timer03.c b/testing/testsuites/kernel/time/cases/clock_test_timer03.c index 421a86397..9839ed73b 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_timer03.c +++ b/testing/testsuites/kernel/time/cases/clock_test_timer03.c @@ -123,7 +123,7 @@ void test_nuttx_clock_test_timer03(FAR void **state) /* 20000000, 2 ticks. */ failed += (escaped < expected || (escaped - expected) >= 20000000); - syslog(LOG_INFO, "expected = %lld escaped = %lld failed = %d", + syslog(LOG_INFO, "expected = %ld escaped = %ld failed = %d", expected, escaped, failed); }