From 4432d84dd32b21b0cbeea4b156e4589eb1ae557a Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Mon, 23 Dec 2024 19:25:53 +0800 Subject: [PATCH] test:driver_audio bug fix Signed-off-by: tengshuangshuang --- examples/camera/camera_main.c | 2 +- testing/drivertest/drivertest_audio.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/camera/camera_main.c b/examples/camera/camera_main.c index 221fa4c4b8b..43f1fff9d52 100644 --- a/examples/camera/camera_main.c +++ b/examples/camera/camera_main.c @@ -680,7 +680,7 @@ int main(int argc, FAR char *argv[]) { gettimeofday(&now, NULL); timersub(&now, &start, &delta); - if (timercmp(&delta, &wait, >)) + if (timercmp(&delta, &wait, > /* For checkpatch */)) { printf("Expire time is pasted. GoTo next state.\n"); if (app_state == APP_STATE_BEFORE_CAPTURE) diff --git a/testing/drivertest/drivertest_audio.c b/testing/drivertest/drivertest_audio.c index 2f019fcdd32..5ce08329f15 100644 --- a/testing/drivertest/drivertest_audio.c +++ b/testing/drivertest/drivertest_audio.c @@ -481,7 +481,7 @@ static bool audio_test_timeout(FAR struct audio_state_s *state, gettimeofday(&now, NULL); timersub(&now, &start, &delta); - return timercmp(&delta, &wait, >); + return timercmp(&delta, &wait, > /* For checkpatch */); } static int audio_test_stop(FAR struct audio_state_s *state, int direction) @@ -741,8 +741,8 @@ static int audio_test_setup(FAR void **audio_state) attr.mq_curmsgs = 0; attr.mq_flags = 0; - snprintf(state->mqname, sizeof(state->mqname), "/tmp/%0lx", - (unsigned long)((uintptr_t)state)); + snprintf(state->mqname, sizeof(state->mqname), "/tmp/%p", + ((void *)state)); state->mq = mq_open(state->mqname, O_RDWR | O_CREAT, 0644, &attr); assert_false(state->mq < 0);