From: Yang Li <yang.lee@linux.alibaba.com> To: mark@fasheh.com Cc: jlbec@evilplan.org, joseph.qi@linux.alibaba.com, ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org, Yang Li <yang.lee@linux.alibaba.com> Subject: [PATCH] ocfs2: Remove unneeded return variable Date: Thu, 4 Feb 2021 11:12:03 +0800 [thread overview] Message-ID: <1612408323-23579-1-git-send-email-yang.lee@linux.alibaba.com> (raw) This patch removes unneeded return variables, using only '0' instead. It fixes the following warning detected by coccinelle: ./fs/ocfs2/stack_o2cb.c:69:5-16: Unneeded variable: "o2dlm_flags". Return "0" on line 84 Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> --- fs/ocfs2/stack_o2cb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c index dbf8b57..2da9633 100644 --- a/fs/ocfs2/stack_o2cb.c +++ b/fs/ocfs2/stack_o2cb.c @@ -66,8 +66,6 @@ static inline int mode_to_o2dlm(int mode) } static int flags_to_o2dlm(u32 flags) { - int o2dlm_flags = 0; - map_flag(DLM_LKF_NOQUEUE, LKM_NOQUEUE); map_flag(DLM_LKF_CANCEL, LKM_CANCEL); map_flag(DLM_LKF_CONVERT, LKM_CONVERT); @@ -81,7 +79,7 @@ static int flags_to_o2dlm(u32 flags) /* map_flag() should have cleared every flag passed in */ BUG_ON(flags != 0); - return o2dlm_flags; + return 0; } #undef map_flag -- 1.8.3.1
WARNING: multiple messages have this Message-ID (diff)
From: Yang Li <yang.lee@linux.alibaba.com> To: mark@fasheh.com Cc: Yang Li <yang.lee@linux.alibaba.com>, ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: [Ocfs2-devel] [PATCH] ocfs2: Remove unneeded return variable Date: Thu, 4 Feb 2021 11:12:03 +0800 [thread overview] Message-ID: <1612408323-23579-1-git-send-email-yang.lee@linux.alibaba.com> (raw) This patch removes unneeded return variables, using only '0' instead. It fixes the following warning detected by coccinelle: ./fs/ocfs2/stack_o2cb.c:69:5-16: Unneeded variable: "o2dlm_flags". Return "0" on line 84 Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> --- fs/ocfs2/stack_o2cb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c index dbf8b57..2da9633 100644 --- a/fs/ocfs2/stack_o2cb.c +++ b/fs/ocfs2/stack_o2cb.c @@ -66,8 +66,6 @@ static inline int mode_to_o2dlm(int mode) } static int flags_to_o2dlm(u32 flags) { - int o2dlm_flags = 0; - map_flag(DLM_LKF_NOQUEUE, LKM_NOQUEUE); map_flag(DLM_LKF_CANCEL, LKM_CANCEL); map_flag(DLM_LKF_CONVERT, LKM_CONVERT); @@ -81,7 +79,7 @@ static int flags_to_o2dlm(u32 flags) /* map_flag() should have cleared every flag passed in */ BUG_ON(flags != 0); - return o2dlm_flags; + return 0; } #undef map_flag -- 1.8.3.1 _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel
next reply other threads:[~2021-02-04 3:13 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-02-04 3:12 Yang Li [this message] 2021-02-04 3:12 ` [Ocfs2-devel] [PATCH] ocfs2: Remove unneeded return variable Yang Li 2021-02-04 4:22 ` kernel test robot 2021-02-04 4:22 ` kernel test robot 2021-02-04 4:22 ` [Ocfs2-devel] " kernel test robot 2021-02-04 5:12 ` Joseph Qi 2021-02-04 5:12 ` [Ocfs2-devel] " Joseph Qi 2021-02-04 16:28 ` Wengang Wang 2021-02-04 16:28 ` Wengang Wang
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=1612408323-23579-1-git-send-email-yang.lee@linux.alibaba.com \ --to=yang.lee@linux.alibaba.com \ --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 \ /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.