[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1620643062-124920-1-git-send-email-jiapeng.chong@linux.alibaba.com>
Date: Mon, 10 May 2021 18:37:42 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: mark@...heh.com
Cc: jlbec@...lplan.org, joseph.qi@...ux.alibaba.com,
ocfs2-devel@....oracle.com, linux-kernel@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH v2] ocfs2: Reomve err less than zero check
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@...ux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.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];
}
--
1.8.3.1
Powered by blists - more mailing lists