Changeset 9b8958b in mainline


Ignore:
Timestamp:
2011-10-07T17:11:07Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
75f9dcd
Parents:
58edcfb
Message:

ohci: Declare iteration variables inside for loops.

Location:
uspace/drv/bus/usb/ohci
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/hc.c

    r58edcfb r9b8958b  
    571571        usb_log_debug2("OHCI HCCA initialized at %p.\n", instance->hcca);
    572572
    573         unsigned i = 0;
    574         for (; i < 32; ++i) {
     573        for (unsigned i = 0; i < 32; ++i) {
    575574                instance->hcca->int_ep[i] =
    576575                    instance->lists[USB_TRANSFER_INTERRUPT].list_head_pa;
  • uspace/drv/bus/usb/ohci/ohci_batch.c

    r58edcfb r9b8958b  
    5252        if (!ohci_batch)
    5353                return;
    54         unsigned i = 0;
    5554        if (ohci_batch->tds) {
    56                 for (; i < ohci_batch->td_count; ++i) {
     55                for (unsigned i = 0; i < ohci_batch->td_count; ++i) {
    5756                        if (i != ohci_batch->leave_td)
    5857                                free32(ohci_batch->tds[i]);
     
    107106        ohci_batch->tds[0] = ohci_endpoint_get(usb_batch->ep)->td;
    108107        ohci_batch->leave_td = 0;
    109         unsigned i = 1;
    110         for (; i <= ohci_batch->td_count; ++i) {
     108
     109        for (unsigned i = 1; i <= ohci_batch->td_count; ++i) {
    111110                ohci_batch->tds[i] = malloc32(sizeof(td_t));
    112111                CHECK_NULL_DISPOSE_RET(ohci_batch->tds[i],
     
    196195        ohci_batch->usb_batch->transfered_size =
    197196            ohci_batch->usb_batch->buffer_size;
    198         for (--i;i < ohci_batch->td_count; ++i)
     197        for (--i;i < ohci_batch->td_count; ++i) {
    199198                ohci_batch->usb_batch->transfered_size
    200199                    -= td_remain_size(ohci_batch->tds[i]);
     200        }
    201201
    202202        /* Clear possible ED HALT */
  • uspace/drv/bus/usb/ohci/pci.c

    r58edcfb r9b8958b  
    8585        bool irq_found = false;
    8686
    87         size_t i;
    88         for (i = 0; i < hw_resources.count; i++) {
     87        for (size_t i = 0; i < hw_resources.count; i++) {
    8988                hw_resource_t *res = &hw_resources.resources[i];
    9089                switch (res->type) {
  • uspace/drv/bus/usb/ohci/root_hub.c

    r58edcfb r9b8958b  
    351351                mask |= 1;
    352352        }
    353         size_t port = 1;
    354         for (; port <= instance->port_count; ++port) {
     353        for (size_t port = 1; port <= instance->port_count; ++port) {
    355354                /* Write-clean bits are those that indicate change */
    356355                if (RHPS_CHANGE_WC_MASK
Note: See TracChangeset for help on using the changeset viewer.