From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
mark@fasheh.com, akpm <akpm@linux-foundation.org>
Cc: jlbec@evilplan.org, ocfs2-devel@oss.oracle.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ocfs2: Reomve err less than zero check
Date: Mon, 10 May 2021 19:33:04 +0800 [thread overview]
Message-ID: <d23cd1ee-0607-6254-621d-85e2981e24d2@linux.alibaba.com> (raw)
In-Reply-To: <1620643062-124920-1-git-send-email-jiapeng.chong@linux.alibaba.com>
On 5/10/21 6:37 PM, Jiapeng Chong wrote:
> Because enum dlm_status starts from 0, the check for err < 0 is always
> false.
>
> Clean up the following coccicheck warning:
>
> fs/ocfs2/dlm/dlmdebug.c:222 dlm_errname() warn: unsigned 'err' is never
> less than zero.
>
> fs/ocfs2/dlm/dlmdebug.c:214 dlm_errmsg() warn: unsigned 'err' is never
> less than zero.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
> Changes in v2:
> -Update commit log.
>
> fs/ocfs2/dlm/dlmdebug.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
> index d442cf5..817914d 100644
> --- a/fs/ocfs2/dlm/dlmdebug.c
> +++ b/fs/ocfs2/dlm/dlmdebug.c
> @@ -211,7 +211,7 @@ void dlm_print_one_lock(struct dlm_lock *lockid)
>
> const char *dlm_errmsg(enum dlm_status err)
> {
> - if (err >= DLM_MAXSTATS || err < 0)
> + if (err >= DLM_MAXSTATS)
> return dlm_errmsgs[DLM_MAXSTATS];
> return dlm_errmsgs[err];
> }
> @@ -219,7 +219,7 @@ const char *dlm_errmsg(enum dlm_status err)
>
> const char *dlm_errname(enum dlm_status err)
> {
> - if (err >= DLM_MAXSTATS || err < 0)
> + if (err >= DLM_MAXSTATS)
> return dlm_errnames[DLM_MAXSTATS];
> return dlm_errnames[err];
> }
>
next prev parent reply other threads:[~2021-05-10 12:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 10:37 Jiapeng Chong
2021-05-10 11:33 ` Joseph Qi [this message]
2021-05-10 15:50 ` [Ocfs2-devel] " Wengang Wang
2021-05-11 2:16 ` 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=d23cd1ee-0607-6254-621d-85e2981e24d2@linux.alibaba.com \
--to=joseph.qi@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=jlbec@evilplan.org \
--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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®