Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/test/test3/test3.c

    r267f235 rb7fd2a0  
    4141#define NUM_FUNCS 20
    4242
    43 static int test3_dev_add(ddf_dev_t *dev);
    44 static int test3_dev_remove(ddf_dev_t *dev);
    45 static int test3_fun_online(ddf_fun_t *fun);
    46 static int test3_fun_offline(ddf_fun_t *fun);
     43static errno_t test3_dev_add(ddf_dev_t *dev);
     44static errno_t test3_dev_remove(ddf_dev_t *dev);
     45static errno_t test3_fun_online(ddf_fun_t *fun);
     46static errno_t test3_fun_offline(ddf_fun_t *fun);
    4747
    4848static driver_ops_t driver_ops = {
     
    6363} test3_t;
    6464
    65 static int register_fun_and_add_to_category(ddf_dev_t *parent,
     65static errno_t register_fun_and_add_to_category(ddf_dev_t *parent,
    6666    const char *base_name, size_t index, const char *class_name,
    6767    ddf_fun_t **pfun)
    6868{
    6969        ddf_fun_t *fun = NULL;
    70         int rc;
     70        errno_t rc;
    7171        char *fun_name = NULL;
    7272       
    73         rc = asprintf(&fun_name, "%s%zu", base_name, index);
    74         if (rc < 0) {
    75                 ddf_msg(LVL_ERROR, "Failed to format string: %s", str_error(rc));
     73        if (asprintf(&fun_name, "%s%zu", base_name, index) < 0) {
     74                ddf_msg(LVL_ERROR, "Failed to format string: No memory");
     75                rc = ENOMEM;
    7676                goto leave;
    7777        }
     
    106106}
    107107
    108 static int fun_remove(ddf_fun_t *fun, const char *name)
     108static errno_t fun_remove(ddf_fun_t *fun, const char *name)
    109109{
    110         int rc;
     110        errno_t rc;
    111111
    112112        ddf_msg(LVL_DEBUG, "fun_remove(%p, '%s')", fun, name);
     
    127127}
    128128
    129 static int test3_dev_add(ddf_dev_t *dev)
     129static errno_t test3_dev_add(ddf_dev_t *dev)
    130130{
    131         int rc = EOK;
     131        errno_t rc = EOK;
    132132        test3_t *test3;
    133133
     
    153153}
    154154
    155 static int test3_dev_remove(ddf_dev_t *dev)
     155static errno_t test3_dev_remove(ddf_dev_t *dev)
    156156{
    157157        test3_t *test3 = (test3_t *)ddf_dev_data_get(dev);
    158158        char *fun_name;
    159         int rc;
     159        errno_t rc;
    160160        size_t i;
    161161
    162162        for (i = 0; i < NUM_FUNCS; i++) {
    163                 rc = asprintf(&fun_name, "test3_%zu", i);
    164                 if (rc < 0) {
    165                         ddf_msg(LVL_ERROR, "Failed to format string: %s", str_error(rc));
     163                if (asprintf(&fun_name, "test3_%zu", i) < 0) {
     164                        ddf_msg(LVL_ERROR, "Failed to format string: No memory");
    166165                        return ENOMEM;
    167166                }
     
    177176}
    178177
    179 static int test3_fun_online(ddf_fun_t *fun)
     178static errno_t test3_fun_online(ddf_fun_t *fun)
    180179{
    181180        ddf_msg(LVL_DEBUG, "test3_fun_online()");
     
    183182}
    184183
    185 static int test3_fun_offline(ddf_fun_t *fun)
     184static errno_t test3_fun_offline(ddf_fun_t *fun)
    186185{
    187186        ddf_msg(LVL_DEBUG, "test3_fun_offline()");
Note: See TracChangeset for help on using the changeset viewer.