From 344ea873477f02f03602d5ba79cb432499ea2e36 Mon Sep 17 00:00:00 2001 From: zms123456 <85141075+zmshahaha@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:09:28 +0800 Subject: [PATCH] [components][smp]remove redundant memset & unlock in smp --- components/drivers/smp/smp.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/components/drivers/smp/smp.c b/components/drivers/smp/smp.c index aa0071c576..da098717e4 100644 --- a/components/drivers/smp/smp.c +++ b/components/drivers/smp/smp.c @@ -33,18 +33,14 @@ static rt_err_t smp_call_handler(struct rt_smp_event *event) } void rt_smp_call_ipi_handler(int vector, void *param) { - int err; int cur_cpu = rt_hw_cpu_id(); - rt_spin_lock(&rt_smp_work[cur_cpu].lock); + rt_spin_lock(&rt_smp_work[cur_cpu].lock); if (rt_smp_work[cur_cpu].event.event_id) { - err = smp_call_handler(&rt_smp_work[cur_cpu].event); - if (err) + if (smp_call_handler(&rt_smp_work[cur_cpu].event) != RT_EOK) { LOG_E("Have no event\n"); - rt_memset(&rt_smp_work[cur_cpu].event, 0, sizeof(struct rt_smp_event)); - rt_spin_unlock(&rt_smp_work[cur_cpu].lock); } rt_memset(&rt_smp_work[cur_cpu].event, 0, sizeof(struct rt_smp_event)); }