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

    r36f0738 rb7fd2a0  
    5252#define NAME "hdaudio"
    5353
    54 static int hda_dev_add(ddf_dev_t *dev);
    55 static int hda_dev_remove(ddf_dev_t *dev);
    56 static int hda_dev_gone(ddf_dev_t *dev);
    57 static int hda_fun_online(ddf_fun_t *fun);
    58 static int hda_fun_offline(ddf_fun_t *fun);
     54static errno_t hda_dev_add(ddf_dev_t *dev);
     55static errno_t hda_dev_remove(ddf_dev_t *dev);
     56static errno_t hda_dev_gone(ddf_dev_t *dev);
     57static errno_t hda_fun_online(ddf_fun_t *fun);
     58static errno_t hda_fun_offline(ddf_fun_t *fun);
    5959
    6060static void hdaudio_interrupt(ipc_call_t *, ddf_dev_t *);
     
    148148};
    149149
    150 static int hda_dev_add(ddf_dev_t *dev)
     150static errno_t hda_dev_add(ddf_dev_t *dev)
    151151{
    152152        ddf_fun_t *fun_pcm = NULL;
     
    160160        int i;
    161161        void *regs = NULL;
    162         int rc;
     162        errno_t rc;
    163163
    164164        ddf_msg(LVL_NOTE, "hda_dev_add()");
     
    318318}
    319319
    320 static int hda_dev_remove(ddf_dev_t *dev)
     320static errno_t hda_dev_remove(ddf_dev_t *dev)
    321321{
    322322        hda_t *hda = (hda_t *)ddf_dev_data_get(dev);
    323         int rc;
     323        errno_t rc;
    324324
    325325        ddf_msg(LVL_DEBUG, "hda_dev_remove(%p)", dev);
     
    340340}
    341341
    342 static int hda_dev_gone(ddf_dev_t *dev)
     342static errno_t hda_dev_gone(ddf_dev_t *dev)
    343343{
    344344        hda_t *hda = (hda_t *)ddf_dev_data_get(dev);
    345         int rc;
     345        errno_t rc;
    346346
    347347        ddf_msg(LVL_DEBUG, "hda_dev_remove(%p)", dev);
     
    356356}
    357357
    358 static int hda_fun_online(ddf_fun_t *fun)
     358static errno_t hda_fun_online(ddf_fun_t *fun)
    359359{
    360360        ddf_msg(LVL_DEBUG, "hda_fun_online()");
     
    362362}
    363363
    364 static int hda_fun_offline(ddf_fun_t *fun)
     364static errno_t hda_fun_offline(ddf_fun_t *fun)
    365365{
    366366        ddf_msg(LVL_DEBUG, "hda_fun_offline()");
Note: See TracChangeset for help on using the changeset viewer.