Skip to contentSkip to conversation

fs: kernfs: file.c: Drop the condition with no effect.

PATCH In review Saurav Girepunje 2 participants 2 messages Oct 29, 2019 kernfs

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: kernfs: file.c: Drop the condition with no effect.

As the "if" and "else" branch body are identical the condition has no effect. So drop the if,else condition.

---
 fs/kernfs/file.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
fs/kernfs/file.c +1 -4
index e8c792b49616..d8123d8cfdcc 100644
@@ -663,10 +663,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;
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 4 lines · Saurav Girepunje

As the "if" and "else" branch body are identical the condition has no effect. So drop the if,else condition.

Nack. Please read the comment right above.

Thanks.

Signature · 1 line
tejun