From 0fad40bc897a08a680a515a46e23e406a32022d0 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 6fce11ccf..a5977e714 100644 --- a/examples/camera/camera_main.c +++ b/examples/camera/camera_main.c @@ -678,7 +678,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 13727beee..4137bc447 100644 --- a/testing/drivertest/drivertest_audio.c +++ b/testing/drivertest/drivertest_audio.c @@ -479,7 +479,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) @@ -739,8 +739,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);