Changeset b7fd2a0 in mainline for uspace/drv/block/ata_bd/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/block/ata_bd/main.c

    r36f0738 rb7fd2a0  
    4141#include "main.h"
    4242
    43 static int ata_dev_add(ddf_dev_t *dev);
    44 static int ata_dev_remove(ddf_dev_t *dev);
    45 static int ata_dev_gone(ddf_dev_t *dev);
    46 static int ata_fun_online(ddf_fun_t *fun);
    47 static int ata_fun_offline(ddf_fun_t *fun);
     43static errno_t ata_dev_add(ddf_dev_t *dev);
     44static errno_t ata_dev_remove(ddf_dev_t *dev);
     45static errno_t ata_dev_gone(ddf_dev_t *dev);
     46static errno_t ata_fun_online(ddf_fun_t *fun);
     47static errno_t ata_fun_offline(ddf_fun_t *fun);
    4848
    4949static void ata_bd_connection(ipc_callid_t, ipc_call_t *, void *);
     
    6262};
    6363
    64 static int ata_get_res(ddf_dev_t *dev, ata_base_t *ata_res)
     64static errno_t ata_get_res(ddf_dev_t *dev, ata_base_t *ata_res)
    6565{
    6666        async_sess_t *parent_sess;
    6767        hw_res_list_parsed_t hw_res;
    68         int rc;
     68        errno_t rc;
    6969
    7070        parent_sess = ddf_dev_parent_sess_get(dev);
     
    108108 * @return     EOK on success or an error code.
    109109 */
    110 static int ata_dev_add(ddf_dev_t *dev)
     110static errno_t ata_dev_add(ddf_dev_t *dev)
    111111{
    112112        ata_ctrl_t *ctrl;
    113113        ata_base_t res;
    114         int rc;
     114        errno_t rc;
    115115
    116116        rc = ata_get_res(dev, &res);
     
    151151}
    152152
    153 int ata_fun_create(disk_t *disk)
     153errno_t ata_fun_create(disk_t *disk)
    154154{
    155155        ata_ctrl_t *ctrl = disk->ctrl;
    156         int rc;
     156        errno_t rc;
    157157        char *fun_name = NULL;
    158158        ddf_fun_t *fun = NULL;
     
    212212}
    213213
    214 int ata_fun_remove(disk_t *disk)
    215 {
    216         int rc;
     214errno_t ata_fun_remove(disk_t *disk)
     215{
     216        errno_t rc;
    217217        char *fun_name;
    218218
     
    250250}
    251251
    252 int ata_fun_unbind(disk_t *disk)
    253 {
    254         int rc;
     252errno_t ata_fun_unbind(disk_t *disk)
     253{
     254        errno_t rc;
    255255        char *fun_name;
    256256
     
    282282}
    283283
    284 static int ata_dev_remove(ddf_dev_t *dev)
     284static errno_t ata_dev_remove(ddf_dev_t *dev)
    285285{
    286286        ata_ctrl_t *ctrl = (ata_ctrl_t *)ddf_dev_data_get(dev);
     
    291291}
    292292
    293 static int ata_dev_gone(ddf_dev_t *dev)
     293static errno_t ata_dev_gone(ddf_dev_t *dev)
    294294{
    295295        ata_ctrl_t *ctrl = (ata_ctrl_t *)ddf_dev_data_get(dev);
     
    300300}
    301301
    302 static int ata_fun_online(ddf_fun_t *fun)
     302static errno_t ata_fun_online(ddf_fun_t *fun)
    303303{
    304304        ddf_msg(LVL_DEBUG, "ata_fun_online()");
     
    306306}
    307307
    308 static int ata_fun_offline(ddf_fun_t *fun)
     308static errno_t ata_fun_offline(ddf_fun_t *fun)
    309309{
    310310        ddf_msg(LVL_DEBUG, "ata_fun_offline()");
Note: See TracChangeset for help on using the changeset viewer.