Changeset 46577995 in mainline for uspace/drv/bus/usb/uhci/uhci_rh.c


Ignore:
Timestamp:
2018-01-04T20:50:52Z (8 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/bus/usb/uhci/uhci_rh.c

    rfacacc71 r46577995  
    7878 * @return Error code, EOK on success.
    7979 */
    80 int uhci_rh_init(uhci_rh_t *instance, ioport16_t *ports, const char *name)
     80errno_t uhci_rh_init(uhci_rh_t *instance, ioport16_t *ports, const char *name)
    8181{
    8282        assert(instance);
     
    9898 * not have to be.
    9999 */
    100 int uhci_rh_schedule(uhci_rh_t *instance, usb_transfer_batch_t *batch)
     100errno_t uhci_rh_schedule(uhci_rh_t *instance, usb_transfer_batch_t *batch)
    101101{
    102102        assert(instance);
     
    193193 * it is usefull for debuging purposes only.
    194194 */
    195 static int req_get_port_state(usbvirt_device_t *device,
     195static errno_t req_get_port_state(usbvirt_device_t *device,
    196196    const usb_device_request_setup_packet_t *setup_packet,
    197197    uint8_t *data, size_t *act_size)
     
    228228 * @note: reset change status needs to be handled in sw.
    229229 */
    230 static int req_get_port_status(usbvirt_device_t *device,
     230static errno_t req_get_port_status(usbvirt_device_t *device,
    231231    const usb_device_request_setup_packet_t *setup_packet,
    232232    uint8_t *data, size_t *act_size)
     
    267267 * @return Error code.
    268268 */
    269 static int req_clear_port_feature(usbvirt_device_t *device,
     269static errno_t req_clear_port_feature(usbvirt_device_t *device,
    270270    const usb_device_request_setup_packet_t *setup_packet,
    271271    uint8_t *data, size_t *act_size)
     
    340340 * @return Error code.
    341341 */
    342 static int req_set_port_feature(usbvirt_device_t *device,
     342static errno_t req_set_port_feature(usbvirt_device_t *device,
    343343    const usb_device_request_setup_packet_t *setup_packet,
    344344    uint8_t *data, size_t *act_size)
     
    402402 * only need 1 byte.
    403403 */
    404 static int req_status_change_handler(usbvirt_device_t *device,
     404static errno_t req_status_change_handler(usbvirt_device_t *device,
    405405    usb_endpoint_t endpoint, usb_transfer_type_t tr_type,
    406406    void *buffer, size_t buffer_size, size_t *actual_size)
Note: See TracChangeset for help on using the changeset viewer.