mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
dlm: combine switch case fail and default statements
This patch combines the failure and default cases for enqueue and dequeue a callback to the lkb callback queue that should end in both cases as it should never happen. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
parent
4ed4242809
commit
0175e51b51
@ -160,11 +160,10 @@ void dlm_add_cb(struct dlm_lkb *lkb, uint32_t flags, int mode, int status,
|
||||
}
|
||||
spin_unlock(&ls->ls_cb_lock);
|
||||
break;
|
||||
case DLM_ENQUEUE_CALLBACK_FAILURE:
|
||||
WARN_ON_ONCE(1);
|
||||
break;
|
||||
case DLM_ENQUEUE_CALLBACK_SUCCESS:
|
||||
break;
|
||||
case DLM_ENQUEUE_CALLBACK_FAILURE:
|
||||
fallthrough;
|
||||
default:
|
||||
WARN_ON_ONCE(1);
|
||||
break;
|
||||
|
@ -231,10 +231,6 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode,
|
||||
|
||||
rv = dlm_enqueue_lkb_callback(lkb, flags, mode, status, sbflags);
|
||||
switch (rv) {
|
||||
case DLM_ENQUEUE_CALLBACK_FAILURE:
|
||||
spin_unlock(&proc->asts_spin);
|
||||
WARN_ON_ONCE(1);
|
||||
goto out;
|
||||
case DLM_ENQUEUE_CALLBACK_NEED_SCHED:
|
||||
kref_get(&lkb->lkb_ref);
|
||||
list_add_tail(&lkb->lkb_cb_list, &proc->asts);
|
||||
@ -242,9 +238,12 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode,
|
||||
break;
|
||||
case DLM_ENQUEUE_CALLBACK_SUCCESS:
|
||||
break;
|
||||
case DLM_ENQUEUE_CALLBACK_FAILURE:
|
||||
fallthrough;
|
||||
default:
|
||||
spin_unlock(&proc->asts_spin);
|
||||
WARN_ON_ONCE(1);
|
||||
break;
|
||||
goto out;
|
||||
}
|
||||
spin_unlock(&proc->asts_spin);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user