Changeset 07525cd in mainline for uspace/lib/usbhid/src/hidparser.c


Ignore:
Timestamp:
2013-09-10T18:34:16Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
08bc23d
Parents:
85147f3
Message:

cstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhid/src/hidparser.c

    r85147f3 r07525cd  
    132132        usb_hid_report_description_t *report_des;
    133133        usb_hid_report_type_t type = USB_HID_REPORT_TYPE_INPUT;
    134 
     134       
    135135        if (report == NULL) {
    136136                return EINVAL;
     
    155155
    156156                if (USB_HID_ITEM_FLAG_CONSTANT(item->item_flags) == 0) {
    157 
     157                       
    158158                        if (USB_HID_ITEM_FLAG_VARIABLE(item->item_flags) == 0) {
    159159                                /* array */
    160160                                item->value =
    161161                                        usb_hid_translate_data(item, data);
    162 
     162                               
    163163                                item->usage = USB_HID_EXTENDED_USAGE(
    164164                                    item->usages[item->value -
     
    185185                }
    186186        }
    187 
     187       
    188188        return EOK;
    189189}
     
    340340        int length;
    341341        int32_t tmp_value;
    342 
     342       
    343343        if (report == NULL) {
    344344                return EINVAL;
     
    352352        report_des = usb_hid_report_find_description(report, report_id,
    353353            USB_HID_REPORT_TYPE_OUTPUT);
    354 
     354       
    355355        if (report_des == NULL) {
    356356                return EINVAL;
     
    364364                offset = report_des->bit_length - report_item->offset - 1;
    365365                length = report_item->size;
    366 
     366               
    367367                usb_log_debug("\ttranslated value: %x\n", value);
    368368
     
    375375                        value = value << shift;
    376376                        value = value & (((1 << length) - 1) << shift);
    377 
     377                       
    378378                        uint8_t mask = 0;
    379379                        mask = 0xff - (((1 << length) - 1) << shift);
     
    391391
    392392                                        tmp_value = tmp_value << (offset % 8);
    393 
     393                                       
    394394                                        mask = ~(((1 << (8 - (offset % 8))) - 1)
    395395                                            << (offset % 8));
     
    398398                                            tmp_value;
    399399                                } else if (i == ((offset + length - 1) / 8)) {
    400 
     400                                       
    401401                                        value = value >> (length -
    402402                                            ((offset + length) % 8));
     
    404404                                        value = value & ((1 << (length -
    405405                                            ((offset + length) % 8))) - 1);
    406 
     406                                       
    407407                                        mask = (1 << (length -
    408408                                            ((offset + length) % 8))) - 1;
     
    418418                report_item->value = 0;
    419419        }
    420 
     420       
    421421        return EOK;
    422422}
Note: See TracChangeset for help on using the changeset viewer.