Changeset 18b6a88 in mainline for uspace/drv/hid


Ignore:
Timestamp:
2018-04-15T09:35:04Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c1f44ca
Parents:
8ebe212
Message:

More ccheck fixes, sometimes with manual intervention.

Location:
uspace/drv/hid/usbhid
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/hid/usbhid/kbd/kbddev.c

    r8ebe212 r18b6a88  
    191191                } else {
    192192                        usb_log_error("%s: console session already set",
    193                            __FUNCTION__);
     193                            __FUNCTION__);
    194194                        async_answer_0(icall_handle, ELIMIT);
    195195                }
    196196                break;
    197197        default:
    198                         usb_log_error("%s: Unknown method: %d.",
    199                             __FUNCTION__, (int) method);
    200                         async_answer_0(icall_handle, EINVAL);
    201                         break;
     198                usb_log_error("%s: Unknown method: %d.",
     199                    __FUNCTION__, (int) method);
     200                async_answer_0(icall_handle, EINVAL);
     201                break;
    202202        }
    203203
     
    236236        while (field != NULL) {
    237237
    238                 if ((field->usage == USB_HID_LED_NUM_LOCK)
    239                     && (kbd_dev->mods & KM_NUM_LOCK)){
     238                if ((field->usage == USB_HID_LED_NUM_LOCK) &&
     239                    (kbd_dev->mods & KM_NUM_LOCK)) {
    240240                        field->value = 1;
    241241                }
    242242
    243                 if ((field->usage == USB_HID_LED_CAPS_LOCK)
    244                     && (kbd_dev->mods & KM_CAPS_LOCK)){
     243                if ((field->usage == USB_HID_LED_CAPS_LOCK) &&
     244                    (kbd_dev->mods & KM_CAPS_LOCK)) {
    245245                        field->value = 1;
    246246                }
    247247
    248                 if ((field->usage == USB_HID_LED_SCROLL_LOCK)
    249                     && (kbd_dev->mods & KM_SCROLL_LOCK)){
     248                if ((field->usage == USB_HID_LED_SCROLL_LOCK) &&
     249                    (kbd_dev->mods & KM_SCROLL_LOCK)) {
    250250                        field->value = 1;
    251251                }
     
    253253                field = usb_hid_report_get_sibling(
    254254                    &hid_dev->report, field, kbd_dev->led_path,
    255                 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     255                    USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    256256                    USB_HID_REPORT_TYPE_OUTPUT);
    257257        }
     
    269269        usb_log_debug("Output report buffer: %s",
    270270            usb_debug_str_buffer(kbd_dev->output_buffer, kbd_dev->output_size,
    271                 0));
     271            0));
    272272
    273273        rc = usbhid_req_set_report(
     
    308308static inline int usb_kbd_is_lock(unsigned int key_code)
    309309{
    310         return (key_code == KC_NUM_LOCK
    311             || key_code == KC_SCROLL_LOCK
    312             || key_code == KC_CAPS_LOCK);
     310        return (key_code == KC_NUM_LOCK ||
     311            key_code == KC_SCROLL_LOCK ||
     312            key_code == KC_CAPS_LOCK);
    313313}
    314314
     
    437437
    438438        errno_t ret =
    439            usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
     439            usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
    440440        if (ret != EOK) {
    441441                usb_log_error("Failed to append to hid/kbd report path.");
     
    461461                if (field->value != 0) {
    462462                        kbd_dev->keys[i] = field->usage;
    463                 }
    464                 else {
     463                } else {
    465464                        kbd_dev->keys[i] = 0;
    466465                }
     
    469468                ++i;
    470469                field = usb_hid_report_get_sibling(
    471                     &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END
    472                         | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     470                    &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END |
     471                    USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    473472                    USB_HID_REPORT_TYPE_INPUT);
    474473        }
     
    742741        // FIXME - the fibril_mutex_is_locked may not cause
    743742        // fibril scheduling
    744         while (fibril_mutex_is_locked(&kbd_dev->repeat_mtx)) {}
     743        while (fibril_mutex_is_locked(&kbd_dev->repeat_mtx)) {
     744        }
    745745
    746746        /* Free all buffers. */
  • uspace/drv/hid/usbhid/mouse/mousedev.c

    r8ebe212 r18b6a88  
    184184            hid_dev->report_id, &hid_dev->report,
    185185            USB_HIDUT_USAGE_GENERIC_DESKTOP_Y);
    186         const usb_hid_report_field_t *wheel= get_mouse_axis_move_field(
     186        const usb_hid_report_field_t *wheel = get_mouse_axis_move_field(
    187187            hid_dev->report_id, &hid_dev->report,
    188188            USB_HIDUT_USAGE_GENERIC_DESKTOP_WHEEL);
     
    232232        }
    233233        errno_t ret =
    234            usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_BUTTON, 0);
     234            usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_BUTTON, 0);
    235235        if (ret != EOK) {
    236236                usb_hid_report_path_free(path);
     
    241241
    242242        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    243             &hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END
    244             | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, USB_HID_REPORT_TYPE_INPUT);
     243            &hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END |
     244            USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, USB_HID_REPORT_TYPE_INPUT);
    245245
    246246        while (field != NULL) {
     
    263263
    264264                field = usb_hid_report_get_sibling(
    265                     &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END
    266                     | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     265                    &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END |
     266                    USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    267267                    USB_HID_REPORT_TYPE_INPUT);
    268268        }
  • uspace/drv/hid/usbhid/multimedia/multimedia.c

    r8ebe212 r18b6a88  
    260260
    261261        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    262             &hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END
    263             | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     262            &hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END |
     263            USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    264264            USB_HID_REPORT_TYPE_INPUT);
    265265
     
    279279
    280280                field = usb_hid_report_get_sibling(
    281                     &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END
    282                     | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     281                    &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END |
     282                    USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
    283283                    USB_HID_REPORT_TYPE_INPUT);
    284284        }
Note: See TracChangeset for help on using the changeset viewer.