Changeset b7fd2a0 in mainline for uspace/drv/char/i8042/i8042.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (9 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, 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/char/i8042/i8042.c

    r36f0738 rb7fd2a0  
    6868
    6969static void i8042_char_conn(ipc_callid_t, ipc_call_t *, void *);
    70 static int i8042_read(chardev_srv_t *, void *, size_t, size_t *);
    71 static int i8042_write(chardev_srv_t *, const void *, size_t, size_t *);
     70static errno_t i8042_read(chardev_srv_t *, void *, size_t, size_t *);
     71static errno_t i8042_write(chardev_srv_t *, const void *, size_t, size_t *);
    7272
    7373static chardev_ops_t i8042_chardev_ops = {
     
    129129{
    130130        i8042_t *controller = ddf_dev_data_get(dev);
    131         int rc;
     131        errno_t rc;
    132132       
    133133        const uint8_t status = IPC_GET_ARG1(*call);
     
    158158 *
    159159 */
    160 int i8042_init(i8042_t *dev, addr_range_t *regs, int irq_kbd,
     160errno_t i8042_init(i8042_t *dev, addr_range_t *regs, int irq_kbd,
    161161    int irq_mouse, ddf_dev_t *ddf_dev)
    162162{
     
    170170        i8042_regs_t *ar;
    171171       
    172         int rc;
     172        errno_t rc;
    173173        bool kbd_bound = false;
    174174        bool aux_bound = false;
     
    350350 *
    351351 */
    352 static int i8042_write(chardev_srv_t *srv, const void *data, size_t size,
     352static errno_t i8042_write(chardev_srv_t *srv, const void *data, size_t size,
    353353    size_t *nwr)
    354354{
     
    385385 *
    386386 */
    387 static int i8042_read(chardev_srv_t *srv, void *dest, size_t size,
     387static errno_t i8042_read(chardev_srv_t *srv, void *dest, size_t size,
    388388    size_t *nread)
    389389{
     
    391391        size_t p;
    392392        uint8_t *destp = (uint8_t *)dest;
    393         int rc;
     393        errno_t rc;
    394394       
    395395        fibril_mutex_lock(&port->buf_lock);
Note: See TracChangeset for help on using the changeset viewer.