mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 08:44:21 +08:00
firmware: arm_sdei: Remove while loop in sdei_event_unregister()
This removes the unnecessary while loop in sdei_event_unregister() because of the following two reasons. This shouldn't cause any functional changes. * The while loop is executed for once, meaning it's not needed in theory. * With the while loop removed, the nested statements can be avoid to make the code a bit cleaner. Signed-off-by: Gavin Shan <gshan@redhat.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20200922130423.10173-10-gshan@redhat.com Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
1bbc755185
commit
b06146b698
@ -491,11 +491,10 @@ int sdei_event_unregister(u32 event_num)
|
||||
|
||||
mutex_lock(&sdei_events_lock);
|
||||
event = sdei_event_find(event_num);
|
||||
do {
|
||||
if (!event) {
|
||||
pr_warn("Event %u not registered\n", event_num);
|
||||
err = -ENOENT;
|
||||
break;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
spin_lock(&sdei_list_lock);
|
||||
@ -505,10 +504,10 @@ int sdei_event_unregister(u32 event_num)
|
||||
|
||||
err = _sdei_event_unregister(event);
|
||||
if (err)
|
||||
break;
|
||||
goto unlock;
|
||||
|
||||
sdei_event_destroy(event);
|
||||
} while (0);
|
||||
unlock:
|
||||
mutex_unlock(&sdei_events_lock);
|
||||
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user