Changeset b7fd2a0 in mainline for kernel/generic/src/ipc/irq.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
  • kernel/generic/src/ipc/irq.c

    r36f0738 rb7fd2a0  
    7878}
    7979
    80 static int ranges_map_and_apply(irq_pio_range_t *ranges, size_t rangecount,
     80static errno_t ranges_map_and_apply(irq_pio_range_t *ranges, size_t rangecount,
    8181    irq_cmd_t *cmds, size_t cmdcount)
    8282{
     
    164164 *
    165165 */
    166 static int code_check(irq_cmd_t *cmds, size_t cmdcount)
     166static errno_t code_check(irq_cmd_t *cmds, size_t cmdcount)
    167167{
    168168        for (size_t i = 0; i < cmdcount; i++) {
     
    226226       
    227227        irq_code_t *code = malloc(sizeof(*code), 0);
    228         int rc = copy_from_uspace(code, ucode, sizeof(*code));
     228        errno_t rc = copy_from_uspace(code, ucode, sizeof(*code));
    229229        if (rc != EOK)
    230230                goto error;
     
    313313 *
    314314 */
    315 int ipc_irq_subscribe(answerbox_t *box, inr_t inr, sysarg_t imethod,
     315errno_t ipc_irq_subscribe(answerbox_t *box, inr_t inr, sysarg_t imethod,
    316316    irq_code_t *ucode, cap_handle_t *uspace_handle)
    317317{
     
    331331         */
    332332        cap_handle_t handle;
    333         int rc = cap_alloc(TASK, &handle);
     333        errno_t rc = cap_alloc(TASK, &handle);
    334334        if (rc != EOK)
    335335                return rc;
     
    390390 *
    391391 */
    392 int ipc_irq_unsubscribe(answerbox_t *box, int handle)
     392errno_t ipc_irq_unsubscribe(answerbox_t *box, int handle)
    393393{
    394394        kobject_t *kobj = cap_unpublish(TASK, handle, KOBJECT_TYPE_IRQ);
Note: See TracChangeset for help on using the changeset viewer.