Changeset e618885 in mainline


Ignore:
Timestamp:
2018-03-13T18:01:47Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ca61894
Parents:
70327bb
git-author:
Jakub Jermar <jakub@…> (2018-03-04 11:56:50)
git-committer:
Jakub Jermar <jakub@…> (2018-03-13 18:01:47)
Message:

Remove dead code

The phone_cap_wait_cb was never called as all phone capabilities are
already destroyed at this point.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ipc.c

    r70327bb re618885  
    753753}
    754754
    755 static bool phone_cap_wait_cb(cap_t *cap, void *arg)
    756 {
    757         phone_t *phone = cap->kobject->phone;
    758         bool *restart = (bool *) arg;
    759 
    760         mutex_lock(&phone->lock);
    761 
    762         /*
    763          * We might have had some IPC_PHONE_CONNECTING phones at the beginning
    764          * of ipc_cleanup(). Depending on whether these were forgotten or
    765          * answered, they will eventually enter the IPC_PHONE_FREE or
    766          * IPC_PHONE_CONNECTED states, respectively.  In the latter case, the
    767          * other side may slam the open phones at any time, in which case we
    768          * will get an IPC_PHONE_SLAMMED phone.
    769          */
    770         if ((phone->state == IPC_PHONE_CONNECTED) ||
    771             (phone->state == IPC_PHONE_SLAMMED)) {
    772                 mutex_unlock(&phone->lock);
    773                 ipc_phone_hangup(phone);
    774                 /*
    775                  * Now there may be one extra active call, which needs to be
    776                  * forgotten.
    777                  */
    778                 ipc_forget_all_active_calls();
    779                 *restart = true;
    780                 return false;
    781         }
    782 
    783         /*
    784          * If the hangup succeeded, it has sent a HANGUP message, the IPC is now
    785          * in HUNGUP state, we wait for the reply to come
    786          */
    787         if (phone->state != IPC_PHONE_FREE) {
    788                 mutex_unlock(&phone->lock);
    789                 return false;
    790         }
    791 
    792         mutex_unlock(&phone->lock);
    793         return true;
    794 }
    795 
    796755/** Wait for all answers to asynchronous calls to arrive. */
    797756static void ipc_wait_for_all_answered_calls(void)
    798757{
    799758        call_t *call;
    800         bool restart;
    801759
    802760restart:
    803         /*
    804          * Go through all phones, until they are all free.
    805          */
    806         restart = false;
    807         if (caps_apply_to_kobject_type(TASK, KOBJECT_TYPE_PHONE,
    808             phone_cap_wait_cb, &restart) &&
    809             atomic_get(&TASK->answerbox.active_calls) == 0) {
     761        if (atomic_get(&TASK->answerbox.active_calls) == 0) {
    810762                /* Got into cleanup */
    811763                return;
    812764        }
    813         if (restart)
    814                 goto restart;
    815765
    816766        call = ipc_wait_for_call(&TASK->answerbox, SYNCH_NO_TIMEOUT,
Note: See TracChangeset for help on using the changeset viewer.