Changeset b7fd2a0 in mainline for uspace/lib/drv/include/ddf/driver.h


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/drv/include/ddf/driver.h

    r36f0738 rb7fd2a0  
    5656         * device.
    5757         */
    58         int (*open)(ddf_fun_t *);
     58        errno_t (*open)(ddf_fun_t *);
    5959       
    6060        /**
     
    8888typedef struct driver_ops {
    8989        /** Callback method for passing a new device to the device driver */
    90         int (*dev_add)(ddf_dev_t *);
     90        errno_t (*dev_add)(ddf_dev_t *);
    9191       
    9292        /** Ask driver to remove a device */
    93         int (*dev_remove)(ddf_dev_t *);
     93        errno_t (*dev_remove)(ddf_dev_t *);
    9494       
    9595        /** Inform driver a device disappeared */
    96         int (*dev_gone)(ddf_dev_t *);
     96        errno_t (*dev_gone)(ddf_dev_t *);
    9797       
    9898        /** Ask driver to online a specific function */
    99         int (*fun_online)(ddf_fun_t *);
     99        errno_t (*fun_online)(ddf_fun_t *);
    100100       
    101101        /** Ask driver to offline a specific function */
    102         int (*fun_offline)(ddf_fun_t *);
     102        errno_t (*fun_offline)(ddf_fun_t *);
    103103} driver_ops_t;
    104104
     
    124124extern void *ddf_fun_data_get(ddf_fun_t *);
    125125extern const char *ddf_fun_get_name(ddf_fun_t *);
    126 extern int ddf_fun_set_name(ddf_fun_t *, const char *);
     126extern errno_t ddf_fun_set_name(ddf_fun_t *, const char *);
    127127extern ddf_dev_t *ddf_fun_get_dev(ddf_fun_t *);
    128 extern int ddf_fun_bind(ddf_fun_t *);
    129 extern int ddf_fun_unbind(ddf_fun_t *);
    130 extern int ddf_fun_online(ddf_fun_t *);
    131 extern int ddf_fun_offline(ddf_fun_t *);
    132 extern int ddf_fun_add_match_id(ddf_fun_t *, const char *, int);
     128extern errno_t ddf_fun_bind(ddf_fun_t *);
     129extern errno_t ddf_fun_unbind(ddf_fun_t *);
     130extern errno_t ddf_fun_online(ddf_fun_t *);
     131extern errno_t ddf_fun_offline(ddf_fun_t *);
     132extern errno_t ddf_fun_add_match_id(ddf_fun_t *, const char *, int);
    133133extern void ddf_fun_set_ops(ddf_fun_t *, const ddf_dev_ops_t *);
    134134extern void ddf_fun_set_conn_handler(ddf_fun_t *, async_port_handler_t);
    135 extern int ddf_fun_add_to_category(ddf_fun_t *, const char *);
     135extern errno_t ddf_fun_add_to_category(ddf_fun_t *, const char *);
    136136
    137137#endif
Note: See TracChangeset for help on using the changeset viewer.