Changeset 239acce in mainline for kernel/generic/src/ipc/ipcrsc.c


Ignore:
Timestamp:
2012-09-04T22:10:56Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cd671c3
Parents:
983cabe8
Message:

Make the phone_alloc() code shorter.

File:
1 edited

Legend:

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

    r983cabe8 r239acce  
    194194        size_t i;
    195195        for (i = 0; i < IPC_MAX_PHONES; i++) {
    196                 if ((task->phones[i].state == IPC_PHONE_HUNGUP) &&
    197                     (atomic_get(&task->phones[i].active_calls) == 0))
    198                         task->phones[i].state = IPC_PHONE_FREE;
     196                phone_t *phone = &task->phones[i];
     197
     198                if ((phone->state == IPC_PHONE_HUNGUP) &&
     199                    (atomic_get(&phone->active_calls) == 0))
     200                        phone->state = IPC_PHONE_FREE;
    199201               
    200                 if (task->phones[i].state == IPC_PHONE_FREE) {
    201                         task->phones[i].state = IPC_PHONE_CONNECTING;
     202                if (phone->state == IPC_PHONE_FREE) {
     203                        phone->state = IPC_PHONE_CONNECTING;
    202204                        break;
    203205                }
Note: See TracChangeset for help on using the changeset viewer.