diff options
| author | Henson <[email protected]> | 2022-01-26 21:39:06 +0800 |
|---|---|---|
| committer | Henson <[email protected]> | 2022-01-26 21:39:06 +0800 |
| commit | 500d26c2570bb3d905e38aed05fd9c9b324a8f6e (patch) | |
| tree | 6b24159e6e081cfbe42963ee8f9a901538f90637 /components/drivers/ipc/dataqueue.c | |
| parent | 9b44535740b7e1deda584e8c7397b40113fa43f0 (diff) | |
optimize code
Diffstat (limited to 'components/drivers/ipc/dataqueue.c')
| -rw-r--r-- | components/drivers/ipc/dataqueue.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/components/drivers/ipc/dataqueue.c b/components/drivers/ipc/dataqueue.c index fc77f83922..94e7b087c5 100644 --- a/components/drivers/ipc/dataqueue.c +++ b/components/drivers/ipc/dataqueue.c @@ -99,10 +99,7 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue, RT_ASSERT(queue->magic == DATAQUEUE_MAGIC); /* current context checking */ - if (timeout != 0) - { - RT_DEBUG_SCHEDULER_AVAILABLE; - } + RT_DEBUG_SCHEDULER_AVAILABLE(timeout != 0); result = RT_EOK; thread = rt_thread_self(); @@ -221,10 +218,7 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue, RT_ASSERT(size != RT_NULL); /* current context checking */ - if (timeout != 0) - { - RT_DEBUG_SCHEDULER_AVAILABLE; - } + RT_DEBUG_SCHEDULER_AVAILABLE(timeout != 0); result = RT_EOK; thread = rt_thread_self(); |
