Changeset b7fd2a0 in mainline for uspace/drv/platform/icp/icp.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (6 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/platform/icp/icp.c

    r36f0738 rb7fd2a0  
    6262} icp_fun_t;
    6363
    64 static int icp_dev_add(ddf_dev_t *dev);
     64static errno_t icp_dev_add(ddf_dev_t *dev);
    6565
    6666static driver_ops_t icp_ops = {
     
    178178}
    179179
    180 static int icp_fun_enable_interrupt(ddf_fun_t *fnode, int irq)
     180static errno_t icp_fun_enable_interrupt(ddf_fun_t *fnode, int irq)
    181181{
    182182        icp_fun_t *fun = icp_fun(fnode);
     
    188188}
    189189
    190 static int icp_fun_disable_interrupt(ddf_fun_t *fnode, int irq)
     190static errno_t icp_fun_disable_interrupt(ddf_fun_t *fnode, int irq)
    191191{
    192192        icp_fun_t *fun = icp_fun(fnode);
     
    198198}
    199199
    200 static int icp_fun_clear_interrupt(ddf_fun_t *fnode, int irq)
     200static errno_t icp_fun_clear_interrupt(ddf_fun_t *fnode, int irq)
    201201{
    202202        icp_fun_t *fun = icp_fun(fnode);
     
    231231};
    232232
    233 static int icp_add_fun(ddf_dev_t *dev, const char *name, const char *str_match_id,
     233static errno_t icp_add_fun(ddf_dev_t *dev, const char *name, const char *str_match_id,
    234234    icp_fun_t *fun_proto)
    235235{
     
    237237
    238238        ddf_fun_t *fnode = NULL;
    239         int rc;
     239        errno_t rc;
    240240
    241241        /* Create new device. */
     
    275275}
    276276
    277 static int icp_add_functions(ddf_dev_t *dev)
    278 {
    279         int rc;
     277static errno_t icp_add_functions(ddf_dev_t *dev)
     278{
     279        errno_t rc;
    280280
    281281        rc = icp_add_fun(dev, "intctl", "integratorcp/intctl",
     
    296296
    297297/** Add device. */
    298 static int icp_dev_add(ddf_dev_t *dev)
     298static errno_t icp_dev_add(ddf_dev_t *dev)
    299299{
    300300        ddf_msg(LVL_NOTE, "icp_dev_add, device handle = %d",
     
    311311int main(int argc, char *argv[])
    312312{
    313         int rc;
     313        errno_t rc;
    314314
    315315        printf(NAME ": HelenOS IntegratorCP platform driver\n");
Note: See TracChangeset for help on using the changeset viewer.