Changeset f959a20f in mainline for uspace/drv


Ignore:
Timestamp:
2019-02-01T22:32:38Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
00b7fc8
Parents:
1a37496
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-01 21:22:39)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-01 22:32:38)
Message:

Avoid directly using .head/.next/.prev of list_t/link_t

Use existing constructs from <adt/list.h> instead.

Location:
uspace/drv/bus/usb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/endpoint_list.c

    r1a37496 rf959a20f  
    160160        const char *qpos = NULL;
    161161        qh_t *prev_qh;
     162        link_t *prev = list_prev(&ep->eplist_link, &instance->endpoint_list);
     163
    162164        /* Remove from the hardware queue */
    163         if (list_first(&instance->endpoint_list) == &ep->eplist_link) {
     165        if (!prev) {
    164166                /* I'm the first one here */
    165167                prev_qh = instance->list_head;
    166168                qpos = "FIRST";
    167169        } else {
    168                 prev_qh = ehci_endpoint_list_instance(ep->eplist_link.prev)->qh;
     170                prev_qh = ehci_endpoint_list_instance(prev)->qh;
    169171                qpos = "NOT FIRST";
    170172        }
  • uspace/drv/bus/usb/ohci/endpoint_list.c

    r1a37496 rf959a20f  
    156156        const char *qpos = NULL;
    157157        ed_t *prev_ed;
     158        link_t *prev_link = list_prev(&ep->eplist_link, &instance->endpoint_list);
    158159        /* Remove from the hardware queue */
    159         if (list_first(&instance->endpoint_list) == &ep->eplist_link) {
     160        if (!prev_link) {
    160161                /* I'm the first one here */
    161162                prev_ed = instance->list_head;
     
    163164        } else {
    164165                ohci_endpoint_t *prev =
    165                     list_get_instance(ep->eplist_link.prev, ohci_endpoint_t, eplist_link);
     166                    list_get_instance(prev_link, ohci_endpoint_t, eplist_link);
    166167                prev_ed = prev->ed;
    167168                qpos = "NOT FIRST";
  • uspace/drv/bus/usb/uhci/transfer_list.c

    r1a37496 rf959a20f  
    233233        const char *qpos = "FIRST";
    234234        qh_t *prev_qh = instance->queue_head;
     235        link_t *prev = list_prev(&uhci_batch->link, &instance->batch_list);
    235236        /* Remove from the hardware queue */
    236         if (list_first(&instance->batch_list) != &uhci_batch->link) {
     237        if (prev) {
    237238                /* There is a batch in front of me */
    238                 prev_qh =
    239                     uhci_transfer_batch_from_link(uhci_batch->link.prev)->qh;
     239                prev_qh = uhci_transfer_batch_from_link(prev)->qh;
    240240                qpos = "NOT FIRST";
    241241        }
Note: See TracChangeset for help on using the changeset viewer.