staging: lustre: remove RETURN macro
[linux-2.6-block.git] / drivers / staging / lustre / lustre / obdecho / echo_client.c
index 80e3a951b95ad5497f6b922c2846182651c75e85..25151b13fefdd8916f8fb7e8061eea1dc5864e9e 100644 (file)
@@ -413,7 +413,7 @@ static int echo_page_init(const struct lu_env *env, struct cl_object *obj,
        mutex_init(&ep->ep_lock);
        cl_page_slice_add(page, &ep->ep_cl, obj, &echo_page_ops);
        atomic_inc(&eco->eo_npages);
-       RETURN(0);
+       return 0;
 }
 
 static int echo_io_init(const struct lu_env *env, struct cl_object *obj,
@@ -435,7 +435,7 @@ static int echo_lock_init(const struct lu_env *env,
                INIT_LIST_HEAD(&el->el_chain);
                atomic_set(&el->el_refcount, 0);
        }
-       RETURN(el == NULL ? -ENOMEM : 0);
+       return el == NULL ? -ENOMEM : 0;
 }
 
 static int echo_conf_set(const struct lu_env *env, struct cl_object *obj,
@@ -473,7 +473,7 @@ static int echo_object_init(const struct lu_env *env, struct lu_object *obj,
                below = under->ld_ops->ldo_object_alloc(env, obj->lo_header,
                                                        under);
                if (below == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                lu_object_add(obj, below);
        }
 
@@ -497,7 +497,7 @@ static int echo_object_init(const struct lu_env *env, struct lu_object *obj,
        list_add_tail(&eco->eo_obj_chain, &ec->ec_objects);
        spin_unlock(&ec->ec_lock);
 
-       RETURN(0);
+       return 0;
 }
 
 /* taken from osc_unpackmd() */
@@ -515,19 +515,19 @@ static int echo_alloc_memmd(struct echo_device *ed,
        LASSERT(*lsmp == NULL);
        OBD_ALLOC(*lsmp, lsm_size);
        if (*lsmp == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        OBD_ALLOC((*lsmp)->lsm_oinfo[0], sizeof(struct lov_oinfo));
        if ((*lsmp)->lsm_oinfo[0] == NULL) {
                OBD_FREE(*lsmp, lsm_size);
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        loi_init((*lsmp)->lsm_oinfo[0]);
        (*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES;
        ostid_set_seq_echo(&(*lsmp)->lsm_oi);
 
-       RETURN(lsm_size);
+       return lsm_size;
 }
 
 static int echo_free_memmd(struct echo_device *ed, struct lov_stripe_md **lsmp)
@@ -544,7 +544,7 @@ static int echo_free_memmd(struct echo_device *ed, struct lov_stripe_md **lsmp)
        OBD_FREE((*lsmp)->lsm_oinfo[0], sizeof(struct lov_oinfo));
        OBD_FREE(*lsmp, lsm_size);
        *lsmp = NULL;
-       RETURN(0);
+       return 0;
 }
 
 static void echo_object_free(const struct lu_env *env, struct lu_object *obj)
@@ -611,7 +611,7 @@ static struct lu_object *echo_object_alloc(const struct lu_env *env,
                eco->eo_cl.co_ops = &echo_cl_obj_ops;
                obj->lo_ops       = &echo_lu_obj_ops;
        }
-       RETURN(obj);
+       return obj;
 }
 
 static struct lu_device_operations echo_device_lu_ops = {
@@ -729,7 +729,7 @@ static int echo_fid_init(struct echo_device *ed, char *obd_name,
 
        OBD_ALLOC_PTR(ed->ed_cl_seq);
        if (ed->ed_cl_seq == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        OBD_ALLOC(prefix, MAX_OBD_NAME + 5);
        if (prefix == NULL)
@@ -746,12 +746,12 @@ static int echo_fid_init(struct echo_device *ed, char *obd_name,
        if (rc)
                GOTO(out_free_seq, rc);
 
-       RETURN(0);
+       return 0;
 
 out_free_seq:
        OBD_FREE_PTR(ed->ed_cl_seq);
        ed->ed_cl_seq = NULL;
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_fid_fini(struct obd_device *obddev)
@@ -764,7 +764,7 @@ static int echo_fid_fini(struct obd_device *obddev)
                ed->ed_cl_seq = NULL;
        }
 
-       RETURN(0);
+       return 0;
 }
 
 static struct lu_device *echo_device_alloc(const struct lu_env *env,
@@ -902,7 +902,7 @@ static struct lu_device *echo_device_alloc(const struct lu_env *env,
        }
 
        ed->ed_next = next;
-       RETURN(&cd->cd_lu_dev);
+       return &cd->cd_lu_dev;
 out:
        switch(cleanup) {
        case 4: {
@@ -1072,11 +1072,11 @@ static struct echo_object *cl_echo_object_find(struct echo_device *d,
 
        /* Never return an object if the obd is to be freed. */
        if (echo_dev2cl(d)->cd_lu_dev.ld_obd->obd_stopping)
-               RETURN(ERR_PTR(-ENODEV));
+               return ERR_PTR(-ENODEV);
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN((void *)env);
+               return (void *)env;
 
        info = echo_env_info(env);
        conf = &info->eti_conf;
@@ -1116,7 +1116,7 @@ static struct echo_object *cl_echo_object_find(struct echo_device *d,
 
 out:
        cl_env_put(env, &refcheck);
-       RETURN(eco);
+       return eco;
 }
 
 static int cl_echo_object_put(struct echo_object *eco)
@@ -1127,7 +1127,7 @@ static int cl_echo_object_put(struct echo_object *eco)
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        /* an external function to kill an object? */
        if (eco->eo_deleted) {
@@ -1138,7 +1138,7 @@ static int cl_echo_object_put(struct echo_object *eco)
 
        cl_object_put(env, obj);
        cl_env_put(env, &refcheck);
-       RETURN(0);
+       return 0;
 }
 
 static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco,
@@ -1184,7 +1184,7 @@ static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco,
                        cl_lock_release(env, lck, "ec enqueue", current);
                }
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int cl_echo_enqueue(struct echo_object *eco, obd_off start, obd_off end,
@@ -1198,7 +1198,7 @@ static int cl_echo_enqueue(struct echo_object *eco, obd_off start, obd_off end,
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        info = echo_env_info(env);
        io = &info->eti_io;
@@ -1242,10 +1242,10 @@ static int cl_echo_cancel0(struct lu_env *env, struct echo_device *ed,
        spin_unlock(&ec->ec_lock);
 
        if (!found)
-               RETURN(-ENOENT);
+               return -ENOENT;
 
        echo_lock_release(env, ecl, still_used);
-       RETURN(0);
+       return 0;
 }
 
 static int cl_echo_cancel(struct echo_device *ed, __u64 cookie)
@@ -1256,12 +1256,12 @@ static int cl_echo_cancel(struct echo_device *ed, __u64 cookie)
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        rc = cl_echo_cancel0(env, ed, cookie);
 
        cl_env_put(env, &refcheck);
-       RETURN(rc);
+       return rc;
 }
 
 static int cl_echo_async_brw(const struct lu_env *env, struct cl_io *io,
@@ -1278,7 +1278,7 @@ static int cl_echo_async_brw(const struct lu_env *env, struct cl_io *io,
                        continue;
                result = result ?: rc;
        }
-       RETURN(result);
+       return result;
 }
 
 static int cl_echo_object_brw(struct echo_object *eco, int rw, obd_off offset,
@@ -1301,7 +1301,7 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, obd_off offset,
        LASSERT(ed->ed_next != NULL);
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        info    = echo_env_info(env);
        io      = &info->eti_io;
@@ -1447,7 +1447,7 @@ static int echo_big_lmm_get(const struct lu_env *env, struct md_object *o,
 
        rc = mo_xattr_get(env, o, &LU_BUF_NULL, XATTR_NAME_LOV);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        /* big_lmm may need to be grown */
        if (info->eti_big_lmmsize < rc) {
@@ -1464,7 +1464,7 @@ static int echo_big_lmm_get(const struct lu_env *env, struct md_object *o,
 
                OBD_ALLOC_LARGE(info->eti_big_lmm, size);
                if (info->eti_big_lmm == NULL)
-                       RETURN(-ENOMEM);
+                       return -ENOMEM;
                info->eti_big_lmmsize = size;
        }
        LASSERT(info->eti_big_lmmsize >= rc);
@@ -1473,13 +1473,13 @@ static int echo_big_lmm_get(const struct lu_env *env, struct md_object *o,
        info->eti_buf.lb_len = info->eti_big_lmmsize;
        rc = mo_xattr_get(env, o, &info->eti_buf, XATTR_NAME_LOV);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        ma->ma_valid |= MA_LOV;
        ma->ma_lmm = info->eti_big_lmm;
        ma->ma_lmm_size = rc;
 
-       RETURN(0);
+       return 0;
 }
 
 int echo_attr_get_complex(const struct lu_env *env, struct md_object *next,
@@ -1543,7 +1543,7 @@ out:
        ma->ma_need = need;
        CDEBUG(D_INODE, "after getattr rc = %d, ma_valid = "LPX64" ma_lmm=%p\n",
               rc, ma->ma_valid, ma->ma_lmm);
-       RETURN(rc);
+       return rc;
 }
 
 static int
@@ -1570,7 +1570,7 @@ echo_md_create_internal(const struct lu_env *env, struct echo_device *ed,
        if (IS_ERR(ec_child)) {
                CERROR("Can not find the child "DFID": rc = %ld\n", PFID(fid),
                        PTR_ERR(ec_child));
-               RETURN(PTR_ERR(ec_child));
+               return PTR_ERR(ec_child);
        }
 
        child = lu_object_locate(ec_child->lo_header, ld->ld_type);
@@ -1636,7 +1636,7 @@ static int echo_create_md_object(const struct lu_env *env,
                return -1;
        parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
        if (parent == NULL)
-               RETURN(-ENXIO);
+               return -ENXIO;
 
        memset(ma, 0, sizeof(*ma));
        memset(spec, 0, sizeof(*spec));
@@ -1666,7 +1666,7 @@ static int echo_create_md_object(const struct lu_env *env,
                /* If name is specified, only create one object by name */
                rc = echo_md_create_internal(env, ed, lu2md(parent), fid, lname,
                                             spec, ma);
-               RETURN(rc);
+               return rc;
        }
 
        /* Create multiple object sequenced by id */
@@ -1686,7 +1686,7 @@ static int echo_create_md_object(const struct lu_env *env,
                fid->f_oid++;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static struct lu_object *echo_md_lookup(const struct lu_env *env,
@@ -1704,7 +1704,7 @@ static struct lu_object *echo_md_lookup(const struct lu_env *env,
        rc = mdo_lookup(env, parent, lname, fid, NULL);
        if (rc) {
                CERROR("lookup %s: rc = %d\n", lname->ln_name, rc);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        /* In the function below, .hs_keycmp resolves to
@@ -1712,7 +1712,7 @@ static struct lu_object *echo_md_lookup(const struct lu_env *env,
        /* coverity[overrun-buffer-val] */
        child = lu_object_find_at(env, &ed->ed_cl.cd_lu_dev, fid, NULL);
 
-       RETURN(child);
+       return child;
 }
 
 static int echo_setattr_object(const struct lu_env *env,
@@ -1733,7 +1733,7 @@ static int echo_setattr_object(const struct lu_env *env,
                return -1;
        parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
        if (parent == NULL)
-               RETURN(-ENXIO);
+               return -ENXIO;
 
        for (i = 0; i < count; i++) {
                struct lu_object *ec_child, *child;
@@ -1744,7 +1744,7 @@ static int echo_setattr_object(const struct lu_env *env,
                if (IS_ERR(ec_child)) {
                        CERROR("Can't find child %s: rc = %ld\n",
                                lname->ln_name, PTR_ERR(ec_child));
-                       RETURN(PTR_ERR(ec_child));
+                       return PTR_ERR(ec_child);
                }
 
                child = lu_object_locate(ec_child->lo_header, ld->ld_type);
@@ -1775,7 +1775,7 @@ static int echo_setattr_object(const struct lu_env *env,
                id++;
                lu_object_put(env, ec_child);
        }
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_getattr_object(const struct lu_env *env,
@@ -1796,7 +1796,7 @@ static int echo_getattr_object(const struct lu_env *env,
                return -1;
        parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
        if (parent == NULL)
-               RETURN(-ENXIO);
+               return -ENXIO;
 
        memset(ma, 0, sizeof(*ma));
        ma->ma_need |= MA_INODE | MA_LOV | MA_PFID | MA_HSM | MA_ACL_DEF;
@@ -1814,14 +1814,14 @@ static int echo_getattr_object(const struct lu_env *env,
                if (IS_ERR(ec_child)) {
                        CERROR("Can't find child %s: rc = %ld\n",
                               lname->ln_name, PTR_ERR(ec_child));
-                       RETURN(PTR_ERR(ec_child));
+                       return PTR_ERR(ec_child);
                }
 
                child = lu_object_locate(ec_child->lo_header, ld->ld_type);
                if (child == NULL) {
                        CERROR("Can not locate the child %s\n", lname->ln_name);
                        lu_object_put(env, ec_child);
-                       RETURN(-EINVAL);
+                       return -EINVAL;
                }
 
                CDEBUG(D_RPCTRACE, "Start getattr object "DFID"\n",
@@ -1839,7 +1839,7 @@ static int echo_getattr_object(const struct lu_env *env,
                lu_object_put(env, ec_child);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_lookup_object(const struct lu_env *env,
@@ -1897,7 +1897,7 @@ static int echo_md_destroy_internal(const struct lu_env *env,
        if (IS_ERR(ec_child)) {
                CERROR("Can't find child %s: rc = %ld\n", lname->ln_name,
                        PTR_ERR(ec_child));
-               RETURN(PTR_ERR(ec_child));
+               return PTR_ERR(ec_child);
        }
 
        child = lu_object_locate(ec_child->lo_header, ld->ld_type);
@@ -1939,7 +1939,7 @@ static int echo_destroy_object(const struct lu_env *env,
 
        parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
        if (parent == NULL)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        memset(ma, 0, sizeof(*ma));
        ma->ma_attr.la_mode = mode;
@@ -1953,7 +1953,7 @@ static int echo_destroy_object(const struct lu_env *env,
                lname->ln_namelen = namelen;
                rc = echo_md_destroy_internal(env, ed, lu2md(parent), lname,
                                              ma);
-               RETURN(rc);
+               return rc;
        }
 
        /*prepare the requests*/
@@ -1972,7 +1972,7 @@ static int echo_destroy_object(const struct lu_env *env,
                id++;
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static struct lu_object *echo_resolve_path(const struct lu_env *env,
@@ -1992,7 +1992,7 @@ static struct lu_object *echo_resolve_path(const struct lu_env *env,
        rc = md->md_ops->mdo_root_get(env, md, fid);
        if (rc) {
                CERROR("get root error: rc = %d\n", rc);
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
        }
 
        /* In the function below, .hs_keycmp resolves to
@@ -2002,7 +2002,7 @@ static struct lu_object *echo_resolve_path(const struct lu_env *env,
        if (IS_ERR(parent)) {
                CERROR("Can not find the parent "DFID": rc = %ld\n",
                        PFID(fid), PTR_ERR(parent));
-               RETURN(parent);
+               return parent;
        }
 
        while (1) {
@@ -2041,9 +2041,9 @@ static struct lu_object *echo_resolve_path(const struct lu_env *env,
                parent = child;
        }
        if (rc)
-               RETURN(ERR_PTR(rc));
+               return ERR_PTR(rc);
 
-       RETURN(parent);
+       return parent;
 }
 
 static void echo_ucred_init(struct lu_env *env)
@@ -2094,17 +2094,17 @@ static int echo_md_handler(struct echo_device *ed, int command,
 
        if (ld == NULL) {
                CERROR("MD echo client is not being initialized properly\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        if (strcmp(ld->ld_type->ldt_name, LUSTRE_MDD_NAME)) {
                CERROR("Only support MDD layer right now!\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        env = cl_env_get(&refcheck);
        if (IS_ERR(env))
-               RETURN(PTR_ERR(env));
+               return PTR_ERR(env);
 
        rc = lu_env_refill_by_tags(env, ECHO_MD_CTX_TAG, ECHO_MD_SES_TAG);
        if (rc != 0)
@@ -2209,7 +2209,7 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
            (on_target ||                      /* set_stripe */
             ec->ec_nstripes != 0)) {      /* LOV */
                CERROR ("No valid oid\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        rc = echo_alloc_memmd(ed, &lsm);
@@ -2296,12 +2296,12 @@ static int echo_get_object(struct echo_object **ecop, struct echo_device *ed,
        if ((oa->o_valid & OBD_MD_FLID) == 0 || ostid_id(&oa->o_oi) == 0) {
                /* disallow use of object id 0 */
                CERROR ("No valid oid\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        rc = echo_alloc_memmd(ed, &lsm);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        lsm->lsm_oi = oa->o_oi;
        if (!(oa->o_valid & OBD_MD_FLGROUP))
@@ -2315,7 +2315,7 @@ static int echo_get_object(struct echo_object **ecop, struct echo_device *ed,
                rc = PTR_ERR(eco);
        if (lsm)
                echo_free_memmd(ed, &lsm);
-       RETURN(rc);
+       return rc;
 }
 
 static void echo_put_object(struct echo_object *eco)
@@ -2447,7 +2447,7 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
 
        if (count <= 0 ||
            (count & (~CFS_PAGE_MASK)) != 0)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        /* XXX think again with misaligned I/O */
        npages = count >> PAGE_CACHE_SHIFT;
@@ -2457,12 +2457,12 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
 
        OBD_ALLOC(pga, npages * sizeof(*pga));
        if (pga == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        OBD_ALLOC(pages, npages * sizeof(*pages));
        if (pages == NULL) {
                OBD_FREE(pga, npages * sizeof(*pga));
-               RETURN(-ENOMEM);
+               return -ENOMEM;
        }
 
        for (i = 0, pgp = pga, off = offset;
@@ -2511,7 +2511,7 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
        }
        OBD_FREE(pga, npages * sizeof(*pga));
        OBD_FREE(pages, npages * sizeof(*pages));
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_client_prep_commit(const struct lu_env *env,
@@ -2531,7 +2531,7 @@ static int echo_client_prep_commit(const struct lu_env *env,
 
        if (count <= 0 || (count & (~CFS_PAGE_MASK)) != 0 ||
            (lsm != NULL && ostid_id(&lsm->lsm_oi) != ostid_id(&oa->o_oi)))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        npages = batch >> PAGE_CACHE_SHIFT;
        tot_pages = count >> PAGE_CACHE_SHIFT;
@@ -2616,7 +2616,7 @@ out:
                OBD_FREE(lnb, npages * sizeof(struct niobuf_local));
        if (rnb)
                OBD_FREE(rnb, npages * sizeof(struct niobuf_remote));
-       RETURN(ret);
+       return ret;
 }
 
 static int echo_client_brw_ioctl(const struct lu_env *env, int rw,
@@ -2637,7 +2637,7 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw,
 
        rc = echo_get_object(&eco, ed, oa);
        if (rc)
-               RETURN(rc);
+               return rc;
 
        oa->o_valid &= ~OBD_MD_FLHANDLE;
 
@@ -2673,7 +2673,7 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw,
                rc = -EINVAL;
        }
        echo_put_object(eco);
-       RETURN(rc);
+       return rc;
 }
 
 static int
@@ -2687,18 +2687,18 @@ echo_client_enqueue(struct obd_export *exp, struct obdo *oa,
        int                  rc;
 
        if (ed->ed_next == NULL)
-               RETURN(-EOPNOTSUPP);
+               return -EOPNOTSUPP;
 
        if (!(mode == LCK_PR || mode == LCK_PW))
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        if ((offset & (~CFS_PAGE_MASK)) != 0 ||
            (nob & (~CFS_PAGE_MASK)) != 0)
-               RETURN(-EINVAL);
+               return -EINVAL;
 
        rc = echo_get_object (&eco, ed, oa);
        if (rc != 0)
-               RETURN(rc);
+               return rc;
 
        end = (nob == 0) ? ((obd_off) -1) : (offset + nob - 1);
        rc = cl_echo_enqueue(eco, offset, end, mode, &ulh->cookie);
@@ -2707,7 +2707,7 @@ echo_client_enqueue(struct obd_export *exp, struct obdo *oa,
                CDEBUG(D_INFO, "Cookie is "LPX64"\n", ulh->cookie);
        }
        echo_put_object(eco);
-       RETURN(rc);
+       return rc;
 }
 
 static int
@@ -2752,11 +2752,11 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
        /* This FID is unpacked just for validation at this point */
        rc = ostid_to_fid(&fid, &oa->o_oi, 0);
        if (rc < 0)
-               RETURN(rc);
+               return rc;
 
        OBD_ALLOC_PTR(env);
        if (env == NULL)
-               RETURN(-ENOMEM);
+               return -ENOMEM;
 
        rc = lu_env_init(env, LCT_DT_THREAD);
        if (rc)
@@ -2958,14 +2958,14 @@ static int echo_client_setup(const struct lu_env *env,
 
        if (lcfg->lcfg_bufcount < 2 || LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
                CERROR("requires a TARGET OBD name\n");
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        tgt = class_name2obd(lustre_cfg_string(lcfg, 1));
        if (!tgt || !tgt->obd_attached || !tgt->obd_set_up) {
                CERROR("device not attached or not set up (%s)\n",
                       lustre_cfg_string(lcfg, 1));
-               RETURN(-EINVAL);
+               return -EINVAL;
        }
 
        spin_lock_init(&ec->ec_lock);
@@ -2977,7 +2977,7 @@ static int echo_client_setup(const struct lu_env *env,
        if (!strcmp(tgt->obd_type->typ_name, LUSTRE_MDT_NAME)) {
                lu_context_tags_update(ECHO_MD_CTX_TAG);
                lu_session_tags_update(ECHO_MD_SES_TAG);
-               RETURN(0);
+               return 0;
        }
 
        OBD_ALLOC(ocd, sizeof(*ocd));
@@ -3012,7 +3012,7 @@ static int echo_client_setup(const struct lu_env *env,
                return (rc);
        }
 
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_client_cleanup(struct obd_device *obddev)
@@ -3023,17 +3023,17 @@ static int echo_client_cleanup(struct obd_device *obddev)
 
        /*Do nothing for Metadata echo client*/
        if (ed == NULL )
-               RETURN(0);
+               return 0;
 
        if (ed->ed_next_ismd) {
                lu_context_tags_clear(ECHO_MD_CTX_TAG);
                lu_session_tags_clear(ECHO_MD_SES_TAG);
-               RETURN(0);
+               return 0;
        }
 
        if (!list_empty(&obddev->obd_exports)) {
                CERROR("still has clients!\n");
-               RETURN(-EBUSY);
+               return -EBUSY;
        }
 
        LASSERT(atomic_read(&ec->ec_exp->exp_refcount) > 0);
@@ -3041,7 +3041,7 @@ static int echo_client_cleanup(struct obd_device *obddev)
        if (rc != 0)
                CERROR("fail to disconnect device: %d\n", rc);
 
-       RETURN(rc);
+       return rc;
 }
 
 static int echo_client_connect(const struct lu_env *env,
@@ -3057,7 +3057,7 @@ static int echo_client_connect(const struct lu_env *env,
                *exp = class_conn2export(&conn);
        }
 
-       RETURN (rc);
+       return rc;
 }
 
 static int echo_client_disconnect(struct obd_export *exp)
@@ -3151,7 +3151,7 @@ static int __init obdecho_init(void)
 
        rc = echo_client_init();
 
-       RETURN(rc);
+       return rc;
 }
 
 static void /*__exit*/ obdecho_exit(void)