Changeset 9b8958b in mainline for uspace/drv/bus/usb/ohci/ohci_batch.c


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 */
Note: See TracChangeset for help on using the changeset viewer.