Changeset b7fd2a0 in mainline for uspace/drv/bus/usb/ehci/res.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/bus/usb/ehci/res.c

    r36f0738 rb7fd2a0  
    6262 * @return Error code.
    6363 */
    64 static int disable_extended_caps(async_sess_t *parent_sess, unsigned eecp)
     64static errno_t disable_extended_caps(async_sess_t *parent_sess, unsigned eecp)
    6565{
    6666        /* nothing to do */
     
    7070        /* Read the first EEC. i.e. Legacy Support register */
    7171        uint32_t usblegsup;
    72         int ret = pci_config_space_read_32(parent_sess,
     72        errno_t ret = pci_config_space_read_32(parent_sess,
    7373            eecp + USBLEGSUP_OFFSET, &usblegsup);
    7474        if (ret != EOK) {
     
    172172}
    173173
    174 int disable_legacy(ddf_dev_t *device)
     174errno_t disable_legacy(ddf_dev_t *device)
    175175{
    176176        assert(device);
     
    184184        hw_res_list_parsed_t res;
    185185        hw_res_list_parsed_init(&res);
    186         int ret = hw_res_get_list_parsed(parent_sess, &res, 0);
     186        errno_t ret = hw_res_get_list_parsed(parent_sess, &res, 0);
    187187        if (ret != EOK) {
    188188                usb_log_error("Failed to get resource list: %s\n",
Note: See TracChangeset for help on using the changeset viewer.