Changeset b7fd2a0 in mainline for uspace/srv/devman/driver.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/srv/devman/driver.c

    r36f0738 rb7fd2a0  
    283283bool start_driver(driver_t *drv)
    284284{
    285         int rc;
     285        errno_t rc;
    286286
    287287        assert(fibril_mutex_is_locked(&drv->driver_mutex));
     
    306306 *                      otherwise.
    307307 */
    308 int stop_driver(driver_t *drv)
     308errno_t stop_driver(driver_t *drv)
    309309{
    310310        async_exch_t *exch;
    311         int retval;
     311        errno_t retval;
    312312       
    313313        log_msg(LOG_DEFAULT, LVL_DEBUG, "stop_driver(drv=\"%s\")", drv->name);
     
    591591       
    592592        /* Send the device name to the driver. */
    593         int rc = async_data_write_start(exch, dev->pfun->name,
     593        errno_t rc = async_data_write_start(exch, dev->pfun->name,
    594594            str_size(dev->pfun->name) + 1);
    595595       
     
    618618}
    619619
    620 int driver_dev_remove(dev_tree_t *tree, dev_node_t *dev)
     620errno_t driver_dev_remove(dev_tree_t *tree, dev_node_t *dev)
    621621{
    622622        async_exch_t *exch;
    623         int retval;
     623        errno_t retval;
    624624        driver_t *drv;
    625625        devman_handle_t handle;
     
    641641}
    642642
    643 int driver_dev_gone(dev_tree_t *tree, dev_node_t *dev)
     643errno_t driver_dev_gone(dev_tree_t *tree, dev_node_t *dev)
    644644{
    645645        async_exch_t *exch;
    646         int retval;
     646        errno_t retval;
    647647        driver_t *drv;
    648648        devman_handle_t handle;
     
    664664}
    665665
    666 int driver_fun_online(dev_tree_t *tree, fun_node_t *fun)
     666errno_t driver_fun_online(dev_tree_t *tree, fun_node_t *fun)
    667667{
    668668        async_exch_t *exch;
    669         int retval;
     669        errno_t retval;
    670670        driver_t *drv;
    671671        devman_handle_t handle;
     
    692692}
    693693
    694 int driver_fun_offline(dev_tree_t *tree, fun_node_t *fun)
     694errno_t driver_fun_offline(dev_tree_t *tree, fun_node_t *fun)
    695695{
    696696        async_exch_t *exch;
    697         int retval;
     697        errno_t retval;
    698698        driver_t *drv;
    699699        devman_handle_t handle;
     
    721721
    722722/** Get list of registered drivers. */
    723 int driver_get_list(driver_list_t *driver_list, devman_handle_t *hdl_buf,
     723errno_t driver_get_list(driver_list_t *driver_list, devman_handle_t *hdl_buf,
    724724    size_t buf_size, size_t *act_size)
    725725{
     
    753753
    754754/** Get list of device functions. */
    755 int driver_get_devices(driver_t *driver, devman_handle_t *hdl_buf,
     755errno_t driver_get_devices(driver_t *driver, devman_handle_t *hdl_buf,
    756756    size_t buf_size, size_t *act_size)
    757757{
Note: See TracChangeset for help on using the changeset viewer.