Changeset 46577995 in mainline for uspace/drv/char/msim-con/msim-con.c


Ignore:
Timestamp:
2018-01-04T20:50:52Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
e211ea04
Parents:
facacc71
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
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.

After this commit, HelenOS is free of code that mixes error codes with non-error
values on the assumption that error codes are negative.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/msim-con/msim-con.c

    rfacacc71 r46577995  
    4343static void msim_con_connection(ipc_callid_t, ipc_call_t *, void *);
    4444
    45 static int msim_con_read(chardev_srv_t *, void *, size_t, size_t *);
    46 static int msim_con_write(chardev_srv_t *, const void *, size_t, size_t *);
     45static errno_t msim_con_read(chardev_srv_t *, void *, size_t, size_t *);
     46static errno_t msim_con_write(chardev_srv_t *, const void *, size_t, size_t *);
    4747
    4848static chardev_ops_t msim_con_chardev_ops = {
     
    6666        msim_con_t *con = (msim_con_t *) arg;
    6767        uint8_t c;
    68         int rc;
     68        errno_t rc;
    6969
    7070        fibril_mutex_lock(&con->buf_lock);
     
    8080
    8181/** Add msim console device. */
    82 int msim_con_add(msim_con_t *con, msim_con_res_t *res)
     82errno_t msim_con_add(msim_con_t *con, msim_con_res_t *res)
    8383{
    8484        ddf_fun_t *fun = NULL;
    8585        bool subscribed = false;
    8686        irq_cmd_t *msim_cmds = NULL;
    87         int rc;
     87        errno_t rc;
    8888
    8989        circ_buf_init(&con->cbuf, con->buf, msim_con_buf_size, 1);
     
    152152
    153153/** Remove msim console device */
    154 int msim_con_remove(msim_con_t *con)
     154errno_t msim_con_remove(msim_con_t *con)
    155155{
    156156        return ENOTSUP;
     
    158158
    159159/** Msim console device gone */
    160 int msim_con_gone(msim_con_t *con)
     160errno_t msim_con_gone(msim_con_t *con)
    161161{
    162162        return ENOTSUP;
     
    169169
    170170/** Read from msim console device */
    171 static int msim_con_read(chardev_srv_t *srv, void *buf, size_t size,
     171static errno_t msim_con_read(chardev_srv_t *srv, void *buf, size_t size,
    172172    size_t *nread)
    173173{
     
    175175        size_t p;
    176176        uint8_t *bp = (uint8_t *) buf;
    177         int rc;
     177        errno_t rc;
    178178
    179179        fibril_mutex_lock(&con->buf_lock);
     
    197197
    198198/** Write to msim console device */
    199 static int msim_con_write(chardev_srv_t *srv, const void *data, size_t size,
     199static errno_t msim_con_write(chardev_srv_t *srv, const void *data, size_t size,
    200200    size_t *nwr)
    201201{
Note: See TracChangeset for help on using the changeset viewer.