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/lib/usbhost/include/usb/host/ddf_helpers.h

    rfacacc71 r46577995  
    4545#include <device/hw_res_parsed.h>
    4646
    47 typedef int (*driver_init_t)(hcd_t *, const hw_res_list_parsed_t *, bool);
     47typedef errno_t (*driver_init_t)(hcd_t *, const hw_res_list_parsed_t *, bool);
    4848typedef void (*driver_fini_t)(hcd_t *);
    49 typedef int (*claim_t)(ddf_dev_t *);
    50 typedef int (*irq_code_gen_t)(irq_code_t *, const hw_res_list_parsed_t *, int *);
     49typedef errno_t (*claim_t)(ddf_dev_t *);
     50typedef errno_t (*irq_code_gen_t)(irq_code_t *, const hw_res_list_parsed_t *, int *);
    5151
    5252typedef struct {
     
    6161} ddf_hc_driver_t;
    6262
    63 int hcd_ddf_add_hc(ddf_dev_t *device, const ddf_hc_driver_t *driver);
     63errno_t hcd_ddf_add_hc(ddf_dev_t *device, const ddf_hc_driver_t *driver);
    6464
    65 int hcd_ddf_setup_hc(ddf_dev_t *device, usb_speed_t max_speed,
     65errno_t hcd_ddf_setup_hc(ddf_dev_t *device, usb_speed_t max_speed,
    6666    size_t bw, bw_count_func_t bw_count);
    6767void hcd_ddf_clean_hc(ddf_dev_t *device);
    68 int hcd_ddf_setup_root_hub(ddf_dev_t *device);
     68errno_t hcd_ddf_setup_root_hub(ddf_dev_t *device);
    6969
    7070hcd_t *dev_to_hcd(ddf_dev_t *dev);
    7171
    72 int hcd_ddf_enable_interrupt(ddf_dev_t *device, int);
    73 int hcd_ddf_get_registers(ddf_dev_t *device, hw_res_list_parsed_t *hw_res);
    74 int hcd_ddf_setup_interrupts(ddf_dev_t *device,
     72errno_t hcd_ddf_enable_interrupt(ddf_dev_t *device, int);
     73errno_t hcd_ddf_get_registers(ddf_dev_t *device, hw_res_list_parsed_t *hw_res);
     74errno_t hcd_ddf_setup_interrupts(ddf_dev_t *device,
    7575    const hw_res_list_parsed_t *hw_res,
    7676    interrupt_handler_t handler,
    77     int (*gen_irq_code)(irq_code_t *, const hw_res_list_parsed_t *, int *),
     77    errno_t (*gen_irq_code)(irq_code_t *, const hw_res_list_parsed_t *, int *),
    7878    cap_handle_t *handle);
    7979void ddf_hcd_gen_irq_handler(ipc_call_t *call, ddf_dev_t *dev);
Note: See TracChangeset for help on using the changeset viewer.