Changeset 3e48c93 in mainline


Ignore:
Timestamp:
2013-12-30T18:48:40Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
09772f4
Parents:
35c874a
Message:

ohci: Use static assert for HCCA structure size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/hw_struct/hcca.h

    r35c874a r3e48c93  
    5858} hcca_t;
    5959
     60STATIC_ASSERT(sizeof(hcca_t) == 256);
     61
    6062/** Allocate properly aligned structure.
    6163 *
     
    6668static inline hcca_t * hcca_get(void)
    6769{
    68         assert(sizeof(hcca_t) == 256);
    69         hcca_t *hcca = memalign(256, sizeof(hcca_t));
     70        hcca_t *hcca = memalign(sizeof(hcca_t), sizeof(hcca_t));
    7071        if (hcca)
    7172                memset(hcca, 0, sizeof(hcca_t));
     
    8384        assert(index < ARRAY_SIZE(hcca->int_ep));
    8485        OHCI_MEM32_WR(hcca->int_ep[index], pa);
    85 
    8686}
    8787#endif
Note: See TracChangeset for help on using the changeset viewer.