Skip to content

Commit 344ea87

Browse files
authored
[components][smp]remove redundant memset & unlock in smp
1 parent 5796e0d commit 344ea87

File tree

1 file changed

+2
-6
lines changed
  • components/drivers/smp

1 file changed

+2
-6
lines changed

components/drivers/smp/smp.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,14 @@ static rt_err_t smp_call_handler(struct rt_smp_event *event)
3333
}
3434
void rt_smp_call_ipi_handler(int vector, void *param)
3535
{
36-
int err;
3736
int cur_cpu = rt_hw_cpu_id();
38-
rt_spin_lock(&rt_smp_work[cur_cpu].lock);
3937

38+
rt_spin_lock(&rt_smp_work[cur_cpu].lock);
4039
if (rt_smp_work[cur_cpu].event.event_id)
4140
{
42-
err = smp_call_handler(&rt_smp_work[cur_cpu].event);
43-
if (err)
41+
if (smp_call_handler(&rt_smp_work[cur_cpu].event) != RT_EOK)
4442
{
4543
LOG_E("Have no event\n");
46-
rt_memset(&rt_smp_work[cur_cpu].event, 0, sizeof(struct rt_smp_event));
47-
rt_spin_unlock(&rt_smp_work[cur_cpu].lock);
4844
}
4945
rt_memset(&rt_smp_work[cur_cpu].event, 0, sizeof(struct rt_smp_event));
5046
}

0 commit comments

Comments
 (0)