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


Ignore:
Timestamp:
2018-04-12T16:27:17Z (8 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/usbhub/usbhub.c

    r76d0981d r3bacee1  
    8383 */
    8484static const usb_endpoint_description_t
    85         status_change_single_tt_only = HUB_STATUS_CHANGE_EP(0),
    86         status_change_mtt_available = HUB_STATUS_CHANGE_EP(1);
     85    status_change_single_tt_only = HUB_STATUS_CHANGE_EP(0),
     86    status_change_mtt_available = HUB_STATUS_CHANGE_EP(1);
    8787
    8888const usb_endpoint_description_t *usb_hub_endpoints [] = {
     
    107107
    108108static bool usb_hub_polling_error_callback(usb_device_t *dev,
    109         errno_t err_code, void *arg)
     109    errno_t err_code, void *arg)
    110110{
    111111        assert(dev);
     
    113113
    114114        usb_log_error("Device %s polling error: %s",
    115                 usb_device_get_name(dev), str_error(err_code));
     115            usb_device_get_name(dev), str_error(err_code));
    116116
    117117        return true;
     
    153153        }
    154154
    155         const usb_endpoint_description_t *status_change = hub_dev->mtt_available
    156             ? &status_change_mtt_available
    157             : &status_change_single_tt_only;
    158 
    159         usb_endpoint_mapping_t *status_change_mapping
    160                 = usb_device_get_mapped_ep_desc(hub_dev->usb_device, status_change);
     155        const usb_endpoint_description_t *status_change = hub_dev->mtt_available ?
     156            &status_change_mtt_available :
     157            &status_change_single_tt_only;
     158
     159        usb_endpoint_mapping_t *status_change_mapping =
     160            usb_device_get_mapped_ep_desc(hub_dev->usb_device, status_change);
    161161        if (!status_change_mapping) {
    162162                usb_log_error("Failed to map the Status Change Endpoint of a hub.");
     
    212212        if (ret != EOK) {
    213213                usb_log_error("(%p) Failed to unbind '%s' function: %s.",
    214                    hub, HUB_FNC_NAME, str_error(ret));
     214                    hub, HUB_FNC_NAME, str_error(ret));
    215215                return ret;
    216216        }
     
    272272 */
    273273static errno_t usb_hub_polling_init(usb_hub_dev_t *hub_dev,
    274         usb_endpoint_mapping_t *mapping)
     274    usb_endpoint_mapping_t *mapping)
    275275{
    276276        errno_t err;
     
    377377        usb_pipe_t *control_pipe = usb_device_get_default_pipe(hub_dev->usb_device);
    378378
    379         usb_descriptor_type_t desc_type = hub_dev->speed >= USB_SPEED_SUPER
    380                 ? USB_DESCTYPE_SSPEED_HUB : USB_DESCTYPE_HUB;
     379        usb_descriptor_type_t desc_type = hub_dev->speed >= USB_SPEED_SUPER ?
     380            USB_DESCTYPE_SSPEED_HUB : USB_DESCTYPE_HUB;
    381381
    382382        /* Get hub descriptor. */
     
    420420            descriptor.characteristics & HUB_CHAR_POWER_PER_PORT_FLAG;
    421421
    422         const uint8_t protocol = usb_device_descriptors(hub_dev->usb_device)
    423                 ->device.device_protocol;
     422        const uint8_t protocol = usb_device_descriptors(hub_dev->usb_device)->device.device_protocol;
    424423        hub_dev->mtt_available = (protocol == 2);
    425424
     
    456455
    457456        if (config_size < sizeof(usb_standard_configuration_descriptor_t)) {
    458             usb_log_error("Configuration descriptor is not big enough"
    459                 " to fit standard configuration descriptor.\n");
    460             return EOVERFLOW;
     457                usb_log_error("Configuration descriptor is not big enough"
     458                    " to fit standard configuration descriptor.\n");
     459                return EOVERFLOW;
    461460        }
    462461
Note: See TracChangeset for help on using the changeset viewer.