Changeset 790318e in mainline


Ignore:
Timestamp:
2011-09-16T11:50:06Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
82a31261
Parents:
058fd76
Message:

uhci,ohci: Remove direction from initialization table.

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

Legend:

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

    r058fd76 r790318e  
    4242#include "utils/malloc32.h"
    4343
    44 static void (*const batch_setup[4][3])(ohci_transfer_batch_t*, usb_direction_t);
     44static void (*const batch_setup[])(ohci_transfer_batch_t*, usb_direction_t);
    4545/*----------------------------------------------------------------------------*/
    4646/** Safely destructs ohci_transfer_batch_t structure
     
    137137
    138138        const usb_direction_t dir = usb_transfer_batch_direction(usb_batch);
    139         assert(batch_setup[usb_batch->ep->transfer_type][dir]);
    140         batch_setup[usb_batch->ep->transfer_type][dir](ohci_batch, dir);
     139        assert(batch_setup[usb_batch->ep->transfer_type]);
     140        batch_setup[usb_batch->ep->transfer_type](ohci_batch, dir);
    141141
    142142        return ohci_batch;
     
    347347}
    348348/*----------------------------------------------------------------------------*/
    349 static void (*const batch_setup[4][3])(ohci_transfer_batch_t*, usb_direction_t) =
    350 {
    351         { batch_control, batch_control, NULL },
    352         { NULL, NULL, NULL },
    353         { batch_data, batch_data, NULL },
    354         { batch_data, batch_data, NULL },
     349static void (*const batch_setup[])(ohci_transfer_batch_t*, usb_direction_t) =
     350{
     351        [USB_TRANSFER_CONTROL] = batch_control,
     352        [USB_TRANSFER_BULK] = batch_data,
     353        [USB_TRANSFER_INTERRUPT] = batch_data,
     354        [USB_TRANSFER_ISOCHRONOUS] = NULL,
    355355};
    356356/**
  • uspace/drv/bus/usb/uhci/uhci_batch.c

    r058fd76 r790318e  
    6868}
    6969/*----------------------------------------------------------------------------*/
    70 static void (*const batch_setup[4][3])(uhci_transfer_batch_t*, usb_direction_t);
     70static void (*const batch_setup[])(uhci_transfer_batch_t*, usb_direction_t);
    7171/*----------------------------------------------------------------------------*/
    7272/** Allocate memory and initialize internal data structure.
     
    141141        const usb_direction_t dir = usb_transfer_batch_direction(usb_batch);
    142142
    143         assert(batch_setup[usb_batch->ep->transfer_type][dir]);
    144         batch_setup[usb_batch->ep->transfer_type][dir](uhci_batch, dir);
     143        assert(batch_setup[usb_batch->ep->transfer_type]);
     144        batch_setup[usb_batch->ep->transfer_type](uhci_batch, dir);
    145145
    146146        return uhci_batch;
     
    336336}
    337337/*----------------------------------------------------------------------------*/
    338 static void (*const batch_setup[4][3])(uhci_transfer_batch_t*, usb_direction_t) =
    339 {
    340         { batch_control, batch_control, NULL },
    341         { NULL, NULL, NULL },
    342         { batch_data, batch_data, NULL },
    343         { batch_data, batch_data, NULL },
     338static void (*const batch_setup[])(uhci_transfer_batch_t*, usb_direction_t) =
     339{
     340        [USB_TRANSFER_CONTROL] = batch_control,
     341        [USB_TRANSFER_BULK] = batch_data,
     342        [USB_TRANSFER_INTERRUPT] = batch_data,
     343        [USB_TRANSFER_ISOCHRONOUS] = NULL,
    344344};
    345345/**
Note: See TracChangeset for help on using the changeset viewer.