Changeset b7fd2a0 in mainline for uspace/drv/audio/sb16/main.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (7 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/drv/audio/sb16/main.c

    r36f0738 rb7fd2a0  
    4747#define NAME "sb16"
    4848
    49 static int sb_add_device(ddf_dev_t *device);
    50 static int sb_get_res(ddf_dev_t *device, addr_range_t **pp_sb_regs,
     49static errno_t sb_add_device(ddf_dev_t *device);
     50static errno_t sb_get_res(ddf_dev_t *device, addr_range_t **pp_sb_regs,
    5151    addr_range_t **pp_mpu_regs, int *irq, int *dma8, int *dma16);
    52 static int sb_enable_interrupt(ddf_dev_t *device, int irq);
     52static errno_t sb_enable_interrupt(ddf_dev_t *device, int irq);
    5353
    5454static driver_ops_t sb_driver_ops = {
     
    8787 * @return Error code.
    8888 */
    89 static int sb_add_device(ddf_dev_t *device)
     89static errno_t sb_add_device(ddf_dev_t *device)
    9090{
    9191        bool handler_regd = false;
     
    9696
    9797        sb16_t *soft_state = ddf_dev_data_alloc(device, sizeof(sb16_t));
    98         int rc = soft_state ? EOK : ENOMEM;
     98        errno_t rc = soft_state ? EOK : ENOMEM;
    9999        if (rc != EOK) {
    100100                ddf_log_error("Failed to allocate sb16 structure.");
     
    173173}
    174174
    175 static int sb_get_res(ddf_dev_t *device, addr_range_t **pp_sb_regs,
     175static errno_t sb_get_res(ddf_dev_t *device, addr_range_t **pp_sb_regs,
    176176    addr_range_t **pp_mpu_regs, int *irq, int *dma8, int *dma16)
    177177{
     
    184184        hw_res_list_parsed_t hw_res;
    185185        hw_res_list_parsed_init(&hw_res);
    186         const int ret = hw_res_get_list_parsed(parent_sess, &hw_res, 0);
     186        const errno_t ret = hw_res_get_list_parsed(parent_sess, &hw_res, 0);
    187187        if (ret != EOK) {
    188188                return ret;
     
    241241}
    242242
    243 static int sb_enable_interrupt(ddf_dev_t *device, int irq)
     243static errno_t sb_enable_interrupt(ddf_dev_t *device, int irq)
    244244{
    245245        async_sess_t *parent_sess = ddf_dev_parent_sess_get(device);
Note: See TracChangeset for help on using the changeset viewer.