Ignore:
Timestamp:
2018-01-13T03:10:29Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a53ed3a
Parents:
36f0738
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.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/ddf_helpers.h

    r36f0738 rb7fd2a0  
    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.