Changeset 3bacee1 in mainline for uspace/drv/bus/usb/ohci/ohci_batch.c


Ignore:
Timestamp:
2018-04-12T16:27:17Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3cf22f9
Parents:
76d0981d
git-author:
Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
git-committer:
Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
Message:

Make ccheck-fix again and commit more good files.

File:
1 edited

Legend:

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

    r76d0981d r3bacee1  
    4848#include "ohci_bus.h"
    4949
    50 static void (*const batch_setup[])(ohci_transfer_batch_t*);
     50static void (*const batch_setup[])(ohci_transfer_batch_t *);
    5151
    5252/** Safely destructs ohci_transfer_batch_t structure
     
    6767 * NULL otherwise.
    6868 */
    69 ohci_transfer_batch_t * ohci_transfer_batch_create(endpoint_t *ep)
     69ohci_transfer_batch_t *ohci_transfer_batch_create(endpoint_t *ep)
    7070{
    7171        assert(ep);
     
    9797                return ENOTSUP;
    9898
    99         ohci_batch->td_count = (usb_batch->size + OHCI_TD_MAX_TRANSFER - 1)
    100             / OHCI_TD_MAX_TRANSFER;
     99        ohci_batch->td_count = (usb_batch->size + OHCI_TD_MAX_TRANSFER - 1) /
     100            OHCI_TD_MAX_TRANSFER;
    101101        /* Control transfer need Setup and Status stage */
    102102        if (usb_batch->ep->transfer_type == USB_TRANSFER_CONTROL) {
     
    110110
    111111        const size_t td_size = ohci_batch->td_count * sizeof(td_t);
    112         const size_t setup_size = (usb_batch->ep->transfer_type == USB_TRANSFER_CONTROL)
    113                 ? USB_SETUP_PACKET_SIZE
    114                 : 0;
     112        const size_t setup_size = (usb_batch->ep->transfer_type == USB_TRANSFER_CONTROL) ?
     113            USB_SETUP_PACKET_SIZE :
     114            0;
    115115
    116116        if (dma_buffer_alloc(&ohci_batch->ohci_dma_buffer, td_size + setup_size)) {
     
    190190                         * we leave the very last(unused) TD behind.
    191191                         */
    192                         usb_batch->transferred_size
    193                             -= td_remain_size(ohci_batch->tds[i]);
     192                        usb_batch->transferred_size -=
     193                            td_remain_size(ohci_batch->tds[i]);
    194194                } else {
    195195                        usb_log_debug("Batch %p found error TD(%zu):%08x.",
     
    289289        /* Data stage */
    290290        size_t td_current = 1;
    291         const char* buffer = ohci_batch->data_buffer;
     291        const char *buffer = ohci_batch->data_buffer;
    292292        size_t remain_size = ohci_batch->base.size;
    293293        while (remain_size > 0) {
     
    347347        char *buffer = ohci_batch->data_buffer;
    348348        while (remain_size > 0) {
    349                 const size_t transfer_size = remain_size > OHCI_TD_MAX_TRANSFER
    350                     ? OHCI_TD_MAX_TRANSFER : remain_size;
     349                const size_t transfer_size = remain_size > OHCI_TD_MAX_TRANSFER ?
     350                    OHCI_TD_MAX_TRANSFER : remain_size;
    351351
    352352                td_init(
     
    374374
    375375/** Transfer setup table. */
    376 static void (*const batch_setup[])(ohci_transfer_batch_t*) =
    377 {
     376static void (*const batch_setup[])(ohci_transfer_batch_t *) =
     377    {
    378378        [USB_TRANSFER_CONTROL] = batch_control,
    379379        [USB_TRANSFER_BULK] = batch_data,
Note: See TracChangeset for help on using the changeset viewer.