[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1611822332-124549-1-git-send-email-abaci-bugfix@linux.alibaba.com>
Date: Thu, 28 Jan 2021 16:25:32 +0800
From: Abaci Team <abaci-bugfix@...ux.alibaba.com>
To: gregkh@...uxfoundation.org
Cc: tj@...nel.org, linux-kernel@...r.kernel.org,
Abaci Team <abaci-bugfix@...ux.alibaba.com>
Subject: [PATCH] kernfs: Remove redundant code
Fix the following coccicheck warnings:
./fs/kernfs/file.c:647:1-3: WARNING: possible condition with no effect
(if == else).
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Suggested-by: Jiapeng Zhong <oswb@...ux.alibaba.com>
Signed-off-by: Abaci Team <abaci-bugfix@...ux.alibaba.com>
---
fs/kernfs/file.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index c757193..9a74c9d 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -644,11 +644,7 @@ static int kernfs_fop_open(struct inode *inode, struct file *file)
* Both paths of the branch look the same. They're supposed to
* look that way and give @of->mutex different static lockdep keys.
*/
- if (has_mmap)
- mutex_init(&of->mutex);
- else
- mutex_init(&of->mutex);
-
+ mutex_init(&of->mutex);
of->kn = kn;
of->file = file;
--
1.8.3.1
Powered by blists - more mailing lists