From: cgel.zte@gmail.com To: mark@fasheh.com Cc: jlbec@evilplan.org, joseph.qi@linux.alibaba.com, ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org, Minghao Chi <chi.minghao@zte.com.cn>, Zeal Robot <zealci@zte.com.cn>, CGEL ZTE <cgel.zte@gmail.com> Subject: [PATCH] fs/ocfs2: remove redundant ret variable Date: Tue, 4 Jan 2022 11:23:32 +0000 [thread overview] Message-ID: <20220104112332.601834-1-chi.minghao@zte.com.cn> (raw) From: Minghao Chi <chi.minghao@zte.com.cn> Return value from dlm_lock() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Signed-off-by: CGEL ZTE <cgel.zte@gmail.com> --- fs/ocfs2/stack_user.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 85a47621e0c0..3027a6a05668 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -683,28 +683,23 @@ static int user_dlm_lock(struct ocfs2_cluster_connection *conn, void *name, unsigned int namelen) { - int ret; - if (!lksb->lksb_fsdlm.sb_lvbptr) lksb->lksb_fsdlm.sb_lvbptr = (char *)lksb + sizeof(struct dlm_lksb); - ret = dlm_lock(conn->cc_lockspace, mode, &lksb->lksb_fsdlm, + return dlm_lock(conn->cc_lockspace, mode, &lksb->lksb_fsdlm, flags|DLM_LKF_NODLCKWT, name, namelen, 0, fsdlm_lock_ast_wrapper, lksb, fsdlm_blocking_ast_wrapper); - return ret; } static int user_dlm_unlock(struct ocfs2_cluster_connection *conn, struct ocfs2_dlm_lksb *lksb, u32 flags) { - int ret; - ret = dlm_unlock(conn->cc_lockspace, lksb->lksb_fsdlm.sb_lkid, + return dlm_unlock(conn->cc_lockspace, lksb->lksb_fsdlm.sb_lkid, flags, &lksb->lksb_fsdlm, lksb); - return ret; } static int user_dlm_lock_status(struct ocfs2_dlm_lksb *lksb) -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: "cgel.zte--- via Ocfs2-devel" <ocfs2-devel@oss.oracle.com> To: mark@fasheh.com Cc: CGEL ZTE <cgel.zte@gmail.com>, Zeal Robot <zealci@zte.com.cn>, linux-kernel@vger.kernel.org, Minghao Chi <chi.minghao@zte.com.cn>, ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH] fs/ocfs2: remove redundant ret variable Date: Tue, 4 Jan 2022 11:23:32 +0000 [thread overview] Message-ID: <20220104112332.601834-1-chi.minghao@zte.com.cn> (raw) From: Minghao Chi <chi.minghao@zte.com.cn> Return value from dlm_lock() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Signed-off-by: CGEL ZTE <cgel.zte@gmail.com> --- fs/ocfs2/stack_user.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 85a47621e0c0..3027a6a05668 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -683,28 +683,23 @@ static int user_dlm_lock(struct ocfs2_cluster_connection *conn, void *name, unsigned int namelen) { - int ret; - if (!lksb->lksb_fsdlm.sb_lvbptr) lksb->lksb_fsdlm.sb_lvbptr = (char *)lksb + sizeof(struct dlm_lksb); - ret = dlm_lock(conn->cc_lockspace, mode, &lksb->lksb_fsdlm, + return dlm_lock(conn->cc_lockspace, mode, &lksb->lksb_fsdlm, flags|DLM_LKF_NODLCKWT, name, namelen, 0, fsdlm_lock_ast_wrapper, lksb, fsdlm_blocking_ast_wrapper); - return ret; } static int user_dlm_unlock(struct ocfs2_cluster_connection *conn, struct ocfs2_dlm_lksb *lksb, u32 flags) { - int ret; - ret = dlm_unlock(conn->cc_lockspace, lksb->lksb_fsdlm.sb_lkid, + return dlm_unlock(conn->cc_lockspace, lksb->lksb_fsdlm.sb_lkid, flags, &lksb->lksb_fsdlm, lksb); - return ret; } static int user_dlm_lock_status(struct ocfs2_dlm_lksb *lksb) -- 2.25.1 _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel
next reply other threads:[~2022-01-04 11:23 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-01-04 11:23 cgel.zte [this message] 2022-01-04 11:23 ` [Ocfs2-devel] [PATCH] fs/ocfs2: remove redundant ret variable cgel.zte--- via Ocfs2-devel 2022-01-05 2:04 ` Joseph Qi 2022-01-05 2:04 ` [Ocfs2-devel] " Joseph Qi via Ocfs2-devel 2022-01-12 8:14 cgel.zte 2022-01-12 11:19 ` Joseph Qi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220104112332.601834-1-chi.minghao@zte.com.cn \ --to=cgel.zte@gmail.com \ --cc=chi.minghao@zte.com.cn \ --cc=jlbec@evilplan.org \ --cc=joseph.qi@linux.alibaba.com \ --cc=linux-kernel@vger.kernel.org \ --cc=mark@fasheh.com \ --cc=ocfs2-devel@oss.oracle.com \ --cc=zealci@zte.com.cn \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.