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>
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.. */
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));
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;
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;