Changeset 4fb6d9ee in mainline


Ignore:
Timestamp:
2011-03-19T12:40:23Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e099f26
Parents:
13b9cb5
Message:

Refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/transfer_list.c

    r13b9cb5 r4fb6d9ee  
    195195        assert(instance->queue_head);
    196196        assert(batch->qh);
     197        assert(fibril_mutex_is_locked(&instance->guard));
     198
    197199        usb_log_debug2(
    198200            "Queue %s: removing batch(%p).\n", instance->name, batch);
    199201
    200         const char * pos = NULL;
     202        const char *qpos = NULL;
    201203        /* Remove from the hardware queue */
    202         if (batch->link.prev == &instance->batch_list) {
     204        if (instance->batch_list.next == &batch->link) {
    203205                /* I'm the first one here */
     206                assert((instance->queue_head->next & LINK_POINTER_ADDRESS_MASK)
     207                    == addr_to_phys(batch->qh));
    204208                instance->queue_head->next = batch->qh->next;
    205                 pos = "FIRST";
     209                qpos = "FIRST";
    206210        } else {
    207211                batch_t *prev =
    208212                    list_get_instance(batch->link.prev, batch_t, link);
     213                assert((prev->qh->next & LINK_POINTER_ADDRESS_MASK)
     214                    == addr_to_phys(batch->qh));
    209215                prev->qh->next = batch->qh->next;
    210                 pos = "NOT FIRST";
    211         }
    212         /* Remove from the driver list */
     216                qpos = "NOT FIRST";
     217        }
     218        /* Remove from the batch list */
    213219        list_remove(&batch->link);
    214         usb_log_debug("Batch(%p) removed (%s) from %s, next element %x.\n",
    215             batch, pos, instance->name, batch->qh->next);
     220        usb_log_debug("Batch(%p) removed (%s) from %s, next %x.\n",
     221            batch, qpos, instance->name, batch->qh->next);
    216222}
    217223/**
Note: See TracChangeset for help on using the changeset viewer.