Skip to content

Commit

Permalink
remove redundant memset & unlock in smp
Browse files Browse the repository at this point in the history
  • Loading branch information
zmshahaha committed Sep 27, 2024
1 parent caac564 commit dce4cb2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions components/drivers/smp/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit dce4cb2

Please sign in to comment.