1
0
Fork 0

staging: lustre: use ERR_CAST() function

use ERR_CAST() function instead of ERR_PTR() and PTR_ERR()
found using coccinelle and err_cast.cocci

Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Laurent Navet 2013-07-05 14:26:33 +02:00 committed by Greg Kroah-Hartman
parent c4f3955397
commit 1dc8548c30
3 changed files with 4 additions and 4 deletions

View File

@ -147,7 +147,7 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren
inode = search_inode_for_lustre(sb, fid);
if (IS_ERR(inode))
RETURN(ERR_PTR(PTR_ERR(inode)));
RETURN(ERR_CAST(inode));
if (is_bad_inode(inode)) {
/* we didn't find the right inode.. */

View File

@ -110,7 +110,7 @@ static struct ll_cl_context *ll_cl_init(struct file *file,
env = cl_env_get(&refcheck);
if (IS_ERR(env))
return ERR_PTR(PTR_ERR(env));
return ERR_CAST(env);
lcc = &vvp_env_info(env)->vti_io_ctx;
memset(lcc, 0, sizeof(*lcc));

View File

@ -443,7 +443,7 @@ struct dt_object *local_file_find_or_create_with_fid(const struct lu_env *env,
ls = ls_device_get(dt);
if (IS_ERR(ls)) {
dto = ERR_PTR(PTR_ERR(ls));
dto = ERR_CAST(ls);
} else {
/* create the object */
dti->dti_attr.la_valid = LA_MODE;
@ -537,7 +537,7 @@ local_index_find_or_create_with_fid(const struct lu_env *env,
ls = ls_device_get(dt);
if (IS_ERR(ls)) {
dto = ERR_PTR(PTR_ERR(ls));
dto = ERR_CAST(ls);
} else {
/* create the object */
dti->dti_attr.la_valid = LA_MODE;