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

    r36f0738 rb7fd2a0  
    6464 * to read as 0.
    6565 */
    66 static int hda_ctl_reg16_set_reset(uint16_t *reg, uint16_t mask)
     66static errno_t hda_ctl_reg16_set_reset(uint16_t *reg, uint16_t mask)
    6767{
    6868        uint16_t val;
     
    116116 *
    117117 */
    118 static int hda_rb_size_select(uint8_t sizecap, uint8_t *selsz)
     118static errno_t hda_rb_size_select(uint8_t sizecap, uint8_t *selsz)
    119119{
    120120        int i;
     
    146146
    147147/** Initialize the CORB */
    148 static int hda_corb_init(hda_t *hda)
     148static errno_t hda_corb_init(hda_t *hda)
    149149{
    150150        uint8_t ctl;
     
    152152        uint8_t sizecap;
    153153        uint8_t selsz;
    154         int rc;
     154        errno_t rc;
    155155
    156156        ddf_msg(LVL_NOTE, "hda_corb_init()");
     
    237237
    238238/** Initialize the RIRB */
    239 static int hda_rirb_init(hda_t *hda)
     239static errno_t hda_rirb_init(hda_t *hda)
    240240{
    241241        uint8_t ctl;
     
    243243        uint8_t sizecap;
    244244        uint8_t selsz;
    245         int rc;
     245        errno_t rc;
    246246
    247247        ddf_msg(LVL_NOTE, "hda_rirb_init()");
     
    372372
    373373/** Write to CORB */
    374 static int hda_corb_write(hda_t *hda, uint32_t *data, size_t count)
     374static errno_t hda_corb_write(hda_t *hda, uint32_t *data, size_t count)
    375375{
    376376        size_t avail;
     
    414414}
    415415
    416 static int hda_rirb_read(hda_t *hda, hda_rirb_entry_t *data)
     416static errno_t hda_rirb_read(hda_t *hda, hda_rirb_entry_t *data)
    417417{
    418418        size_t wp;
     
    436436}
    437437
    438 static int hda_solrb_read(hda_t *hda, hda_rirb_entry_t *data, size_t count)
     438static errno_t hda_solrb_read(hda_t *hda, hda_rirb_entry_t *data, size_t count)
    439439{
    440440        hda_rirb_entry_t resp;
     
    490490        uint32_t intctl;
    491491        int cnt;
    492         int rc;
     492        errno_t rc;
    493493
    494494        ctl = calloc(1, sizeof(hda_ctl_t));
     
    615615}
    616616
    617 int hda_cmd(hda_t *hda, uint32_t verb, uint32_t *resp)
    618 {
    619         int rc;
     617errno_t hda_cmd(hda_t *hda, uint32_t verb, uint32_t *resp)
     618{
     619        errno_t rc;
    620620        hda_rirb_entry_t rentry;
    621621
     
    639639{
    640640        hda_rirb_entry_t resp;
    641         int rc;
     641        errno_t rc;
    642642
    643643        while (true) {
Note: See TracChangeset for help on using the changeset viewer.