From: Amitoj Kaur Chawla Date: Sun, 21 Feb 2016 06:04:48 +0000 (+0530) Subject: staging: lustre: llite: Remove IS_ERR tests X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=020ecc6f3229d0413e596a941b52263285c601f6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: lustre: llite: Remove IS_ERR tests ll_iget() has been modified to always return NULL in case of error and not a ERR_PTR. Consequently, remove unnecessary IS_ERR tests as now ll_iget() function can never return a ERR_PTR. Additionally, reinitialising root and inode to NULL has been removed since they have already been tested for the same. Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 9ae1cc8ab47a..1f3e8e8f78cf 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -496,7 +496,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, md_free_lustre_md(sbi->ll_md_exp, &lmd); ptlrpc_req_finished(request); - if (IS_ERR_OR_NULL(root)) { + if (!(root)) { if (lmd.lsm) obd_free_memmd(sbi->ll_dt_exp, &lmd.lsm); #ifdef CONFIG_FS_POSIX_ACL @@ -505,8 +505,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, lmd.posix_acl = NULL; } #endif - err = IS_ERR(root) ? PTR_ERR(root) : -EBADF; - root = NULL; + err = -EBADF; CERROR("lustre_lite: bad iget4 for root\n"); goto out_root; } @@ -1983,15 +1982,14 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, *inode = ll_iget(sb, cl_fid_build_ino(&md.body->fid1, sbi->ll_flags & LL_SBI_32BIT_API), &md); - if (IS_ERR_OR_NULL(*inode)) { + if (!inode) { #ifdef CONFIG_FS_POSIX_ACL if (md.posix_acl) { posix_acl_release(md.posix_acl); md.posix_acl = NULL; } #endif - rc = IS_ERR(*inode) ? PTR_ERR(*inode) : -ENOMEM; - *inode = NULL; + rc = -ENOMEM; CERROR("new_inode -fatal: rc %d\n", rc); goto out; } diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 3121458e9b8d..56d2d1d392bd 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -127,7 +127,7 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash, } if (rc != 0) { iget_failed(inode); - inode = ERR_PTR(rc); + inode = NULL; } else unlock_new_inode(inode); } else if (!(inode->i_state & (I_FREEING | I_CLEAR)))