firmware: arm_sdei: clean up sdei_event_create()
Function sdei_event_find() is always called in sdei_event_create(), but it is already called in sdei_event_register(). This code is trying to avoid a double-create of the same event, which can't happen as we still hold the sdei_events_lock. We can remove this needless sdei_event_find() call. Signed-off-by: Liguang Zhang <zhangliguang@linux.alibaba.com> [expanded commit message] Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:
Родитель
54f529a680
Коммит
f7d5ef0c65
|
@ -267,15 +267,9 @@ static struct sdei_event *sdei_event_create(u32 event_num,
|
|||
event->private_registered = regs;
|
||||
}
|
||||
|
||||
if (sdei_event_find(event_num)) {
|
||||
kfree(event->registered);
|
||||
kfree(event);
|
||||
event = ERR_PTR(-EBUSY);
|
||||
} else {
|
||||
spin_lock(&sdei_list_lock);
|
||||
list_add(&event->list, &sdei_list);
|
||||
spin_unlock(&sdei_list_lock);
|
||||
}
|
||||
spin_lock(&sdei_list_lock);
|
||||
list_add(&event->list, &sdei_list);
|
||||
spin_unlock(&sdei_list_lock);
|
||||
|
||||
return event;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче