Changeset 46577995 in mainline for uspace/drv/bus/usb/usbmid/main.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/usbmid/main.c

    rfacacc71 r46577995  
    4949 * @return Error code.
    5050 */
    51 static int usbmid_device_add(usb_device_t *dev)
     51static errno_t usbmid_device_add(usb_device_t *dev)
    5252{
    5353        usb_log_info("Taking care of new MID `%s'.\n", usb_device_get_name(dev));
     
    6161 * @return Error code.
    6262 */
    63 static int usbmid_device_remove(usb_device_t *dev)
     63static errno_t usbmid_device_remove(usb_device_t *dev)
    6464{
    6565        assert(dev);
     
    6868
    6969        /* Remove ctl function */
    70         int ret = ddf_fun_unbind(usb_mid->ctl_fun);
     70        errno_t ret = ddf_fun_unbind(usb_mid->ctl_fun);
    7171        if (ret != EOK) {
    7272                usb_log_error("Failed to unbind USB MID ctl function: %s.\n",
     
    8787
    8888                /* Tell the child to go off-line. */
    89                 int pret = ddf_fun_offline(iface->fun);
     89                errno_t pret = ddf_fun_offline(iface->fun);
    9090                if (pret != EOK) {
    9191                        usb_log_warning("Failed to turn off child `%s': %s\n",
     
    110110 * @return Error code.
    111111 */
    112 static int usbmid_device_gone(usb_device_t *dev)
     112static errno_t usbmid_device_gone(usb_device_t *dev)
    113113{
    114114        assert(dev);
     
    119119
    120120        /* Remove ctl function */
    121         int ret = ddf_fun_unbind(usb_mid->ctl_fun);
     121        errno_t ret = ddf_fun_unbind(usb_mid->ctl_fun);
    122122        if (ret != EOK) {
    123123                usb_log_error("Failed to unbind USB MID ctl function: %s.\n",
     
    137137                    ddf_fun_get_name(iface->fun));
    138138
    139                 const int pret = usbmid_interface_destroy(iface);
     139                const errno_t pret = usbmid_interface_destroy(iface);
    140140                if (pret != EOK) {
    141141                        usb_log_error("Failed to remove child `%s': %s\n",
Note: See TracChangeset for help on using the changeset viewer.