Changeset b7fd2a0 in mainline for uspace/drv/intctl/i8259/i8259.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/intctl/i8259/i8259.c

    r36f0738 rb7fd2a0  
    6464#define PIC_MAX_IRQ  15
    6565
    66 static int pic_enable_irq(i8259_t *i8259, sysarg_t irq)
     66static errno_t pic_enable_irq(i8259_t *i8259, sysarg_t irq)
    6767{
    6868        if (irq > PIC_MAX_IRQ)
     
    136136
    137137/** Add i8259 device. */
    138 int i8259_add(i8259_t *i8259, i8259_res_t *res)
     138errno_t i8259_add(i8259_t *i8259, i8259_res_t *res)
    139139{
    140140        sysarg_t have_i8259;
     
    142142        ioport8_t *regs1;
    143143        ddf_fun_t *fun_a = NULL;
    144         int rc;
     144        errno_t rc;
    145145       
    146146        if ((sysinfo_get_value("i8259", &have_i8259) != EOK) || (!have_i8259)) {
     
    187187
    188188/** Remove i8259 device */
    189 int i8259_remove(i8259_t *i8259)
     189errno_t i8259_remove(i8259_t *i8259)
    190190{
    191191        return ENOTSUP;
     
    193193
    194194/** i8259 device gone */
    195 int i8259_gone(i8259_t *i8259)
     195errno_t i8259_gone(i8259_t *i8259)
    196196{
    197197        return ENOTSUP;
Note: See TracChangeset for help on using the changeset viewer.