[PATCH v5] tools/testing:Fix the wrong format specifier

2024-07-25 Thread Zhu Jun
The format specifier in fprintf is "%u", that "%u" should use unsigned int type instead.the problem is discovered by reading code. Signed-off-by: Zhu Jun --- v1->v2: modify commit info add how to find the problem in the log v2->v3: Seems this can use

[PATCH v4] tools/testing:Fix the wrong format specifier

2024-07-24 Thread Zhu Jun
The format specifier in fprintf is "%u", that "%u" should use unsigned int type instead.the problem is discovered by reading code. Signed-off-by: Zhu Jun --- v1->v2: modify commit info add how to find the problem in the log v2->v3: Seems this can use

[PATCH v3] selftests:Fix printf format string in kselftest_harness.h

2024-07-23 Thread Zhu Jun
'%u' in format string requires 'unsigned int' in __wait_for_test() but the argument type is 'signed int' that this problem was discovered by reading code.use macro WTERMSIG like those above usage to fix the wrong format specifier. Signed-off-by: Zhu Jun --- Changes

[RESEND bpf-next v2] selftests/bpf:fix a resource leak

2024-07-23 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- Changes in v2: - check for cg_fd >= 0 and have just one out label tools/testing/selftests/bpf/test_sockmap.c | 11 +++ 1 file changed, 7 insertions(+)

[RESEND PATCH v2] selftests:Fix printf format string in kselftest_harness.h

2024-07-23 Thread Zhu Jun
'%u' in format string requires 'unsigned int' in __wait_for_test() but the argument type is 'signed int' that this problem was discovered by reading code Signed-off-by: Zhu Jun --- Changes in v2: - modify commit info add how to find the problem in the

[RESEND bpf-next v2] selftests/bpf:fix a resource leak

2024-07-11 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- Changes in v2: - check for cg_fd >= 0 and have just one out label tools/testing/selftests/bpf/test_sockmap.c | 11 +++ 1 file changed, 7 insertions(+)

[PATCH v2] selftests:Fix printf format string in kselftest_harness.h

2024-07-11 Thread Zhu Jun
'%u' in format string requires 'unsigned int' in __wait_for_test() but the argument type is 'signed int' that this problem was discovered by reading code Signed-off-by: Zhu Jun --- Changes in v2: - modify commit info add how to find the problem in the

[PATCH v2] selftests/rtc:Fix a resource leak

2024-07-10 Thread Zhu Jun
The opened file should be closed before exit, otherwise resource leak will occur that this problem was discovered by code reading Signed-off-by: Zhu Jun --- >From a good programming practice perspective, especially in more complex >programs, explicitly freeing allocated memory is a good

[PATCH] selftests/memfd:Fix a resource leak

2024-07-10 Thread Zhu Jun
>From a good programming practice perspective, especially in more complex programs, explicitly freeing allocated memory is a good habit. Signed-off-by: Zhu Jun --- tools/testing/selftests/memfd/memfd_test.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/me

[PATCH] selftests/dma:remove unused variable

2024-07-09 Thread Zhu Jun
The variable are never referenced in the code, just remove it that this problem was discovered by reading code Signed-off-by: Zhu Jun --- tools/testing/selftests/dma/dma_map_benchmark.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/dma/dma_map_benchmark.c b/tools

[PATCH] selftests/dma:Fix a resource leak

2024-07-09 Thread Zhu Jun
The opened file should be closed in main(), otherwise resource leak will occur that this problem was discovered by reading code Signed-off-by: Zhu Jun --- tools/testing/selftests/dma/dma_map_benchmark.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/dma

[PATCH] selftests/rtc:Fix a resource leak

2024-07-09 Thread Zhu Jun
The opened file should be closed before exit, otherwise resource leak will occur that this problem was discovered by reading code Signed-off-by: Zhu Jun --- tools/testing/selftests/rtc/setdate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/rtc/setdate.c b/tools

[PATCH] selftests:Fix printf format string in kselftest_harness.h

2024-07-09 Thread Zhu Jun
'%u' in format string requires 'unsigned int' in __wait_for_test() but the argument type is 'signed int'. Signed-off-by: Zhu Jun --- tools/testing/selftests/kselftest_harness.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/se

[PATCH v2] selftests/breakpoints:Add return value in main function

2024-07-09 Thread Zhu Jun
Main function return value is int type, so add return value in the end that this problem was discovered by reading the code Signed-off-by: Zhu Jun --- Changes in v2: - modify commit info tools/testing/selftests/breakpoints/step_after_suspend_test.c | 4 +++- 1 file changed, 3 insertions

[PATCH v2] selftests/breakpoints:Remove unused variable

2024-07-09 Thread Zhu Jun
This variable is never referenced in the code, just remove them that this problem was discovered by reading the code Signed-off-by: Zhu Jun --- Changes in v2: - modify commit info tools/testing/selftests/breakpoints/step_after_suspend_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a

[PATCH bpf-next v2] selftests/bpf:fix a resource leak

2024-07-09 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- Changes in v2: - check for cg_fd >= 0 and have just one out label tools/testing/selftests/bpf/test_sockmap.c | 11 +++ 1 file changed, 7 insertions(+)

[RESEND] selftests/breakpoints:Add return value in main function

2024-07-09 Thread Zhu Jun
Main function return value is int type, so add return value in the end Signed-off-by: Zhu Jun --- tools/testing/selftests/breakpoints/step_after_suspend_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/breakpoints/step_after_suspend_test.c b

[RESEND] selftests/breakpoints:Remove unused variable

2024-07-09 Thread Zhu Jun
This variable is never referenced in the code, just remove them. Signed-off-by: Zhu Jun --- tools/testing/selftests/breakpoints/step_after_suspend_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/breakpoints/step_after_suspend_test.c b/tools/testing/selftests

[PATCH] selftests/bpf:fix a resource leak

2024-07-09 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- v1 -> v2: check for cg_fd >= 0 and have just one out label tools/testing/selftests/bpf/test_sockmap.c | 11 +++ 1 file changed, 7 insertions(+), 4 del

[PATCH] selftests/breakpoints:Add return value in main function

2024-06-30 Thread Zhu Jun
Main function return value is int type, so add return value in the end Signed-off-by: Zhu Jun --- .../testing/selftests/breakpoints/step_after_suspend_test.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/breakpoints/step_after_suspend_test.c

[PATCH] selftests/breakpoints:Remove unused variable

2024-06-30 Thread Zhu Jun
This variable is never referenced in the code, just remove them. Signed-off-by: Zhu Jun --- tools/testing/selftests/breakpoints/step_after_suspend_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/breakpoints/step_after_suspend_test.c b/tools/testing/selftests

[PATCH] selftests/bpf:fix a resource leak

2024-06-30 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- tools/testing/selftests/bpf/test_sockmap.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/bpf

[PATCH] selftests/bpf:fix a resource leak

2024-06-26 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- tools/testing/selftests/bpf/test_sockmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools

[PATCH] selftests/bpf:Delete extra blank Lines

2024-06-26 Thread Zhu Jun
Delete extra blank lines inside of test_selftest() Signed-off-by: Zhu Jun --- tools/testing/selftests/bpf/test_sockmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c index 92752f5eeded..a34e95040994

[PATCH] selftests/alsa:Add memset to initialize memory

2024-06-26 Thread Zhu Jun
Add memset to initialize the requested memory Signed-off-by: Zhu Jun --- tools/testing/selftests/alsa/test-pcmtest-driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/alsa/test-pcmtest-driver.c b/tools/testing/selftests/alsa/test-pcmtest-driver.c index

[PATCH] selftests/alsa:Replace malloc with calloc

2024-06-26 Thread Zhu Jun
Using calloc to handling memory allocation, calloc can initialize the allocated memory Signed-off-by: Zhu Jun --- tools/testing/selftests/alsa/test-pcmtest-driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/alsa/test-pcmtest-driver.c b/tools/testing/selftests

[PATCH] selftests/alsa:Fix printf format string in pcm-test.c

2024-06-26 Thread Zhu Jun
Inside of test_pcm_time() arguments are printed via printf but '%d' is used to print @flags (of type unsigned int). Use '%u' instead, just like we do everywhere else. Signed-off-by: Zhu Jun --- tools/testing/selftests/alsa/pcm-test.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH v1] selftests/media_tests: fix a resource leak

2023-11-21 Thread Zhu Jun
conventions thanks, [Zhu Jun] tools/testing/selftests/media_tests/media_device_open.c | 2 ++ tools/testing/selftests/media_tests/media_device_test.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/testing/selftests/media_tests/media_device_open.c b/tools/testing/selftests/media_tests