Changeset 46577995 in mainline for uspace/drv/hid/usbhid/kbd/kbddev.c


Ignore:
Timestamp:
2018-01-04T20:50:52Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
e211ea04
Parents:
facacc71
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

After this commit, HelenOS is free of code that mixes error codes with non-error
values on the assumption that error codes are negative.

File:
1 edited

Legend:

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

    rfacacc71 r46577995  
    257257
    258258        // TODO: what about the Report ID?
    259         int rc = usb_hid_report_output_translate(&hid_dev->report, 0,
     259        errno_t rc = usb_hid_report_output_translate(&hid_dev->report, 0,
    260260            kbd_dev->output_buffer, kbd_dev->output_size);
    261261
     
    435435        }
    436436
    437         int ret =
     437        errno_t ret =
    438438           usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
    439439        if (ret != EOK) {
     
    480480/* HID/KBD structure manipulation                                             */
    481481
    482 static int kbd_dev_init(usb_kbd_t *kbd_dev, usb_hid_dev_t *hid_dev)
     482static errno_t kbd_dev_init(usb_kbd_t *kbd_dev, usb_hid_dev_t *hid_dev)
    483483{
    484484        assert(kbd_dev);
     
    507507        }
    508508
    509         int ret =
     509        errno_t ret =
    510510            usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
    511511        if (ret != EOK) {
     
    616616 * @return Other value inherited from function usbhid_dev_init().
    617617 */
    618 int usb_kbd_init(usb_hid_dev_t *hid_dev, void **data)
     618errno_t usb_kbd_init(usb_hid_dev_t *hid_dev, void **data)
    619619{
    620620        usb_log_debug("Initializing HID/KBD structure...\n");
     
    642642        }
    643643
    644         int ret = kbd_dev_init(kbd_dev, hid_dev);
     644        errno_t ret = kbd_dev_init(kbd_dev, hid_dev);
    645645        if (ret != EOK) {
    646646                usb_log_error("Failed to initialize KBD device  structure.\n");
     
    775775}
    776776
    777 int usb_kbd_set_boot_protocol(usb_hid_dev_t *hid_dev)
     777errno_t usb_kbd_set_boot_protocol(usb_hid_dev_t *hid_dev)
    778778{
    779779        assert(hid_dev);
    780         int rc = usb_hid_parse_report_descriptor(
     780        errno_t rc = usb_hid_parse_report_descriptor(
    781781            &hid_dev->report, USB_KBD_BOOT_REPORT_DESCRIPTOR,
    782782            sizeof(USB_KBD_BOOT_REPORT_DESCRIPTOR));
Note: See TracChangeset for help on using the changeset viewer.