Skip to contentSkip to conversation

ocfs2: remove an unnecessary condition

PATCH Applied Dan Carpenter 2 participants 2 messages Jul 8, 2021 – Jul 12, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: remove an unnecessary condition

The case where "tmp_oh" is NULL is handled at the start of the function. At this point we know it's non-NULL so this will always return 1.

---
 fs/ocfs2/dlmglue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/dlmglue.c +1 -1
index 48fd369c29a4..33fbdc823278 100644
@@ -2721,7 +2721,7 @@ int ocfs2_inode_lock_tracker(struct inode *inode,
 			return status;
 		}
 	}
-	return tmp_oh ? 1 : 0;
+	return 1;
 }
 
 void ocfs2_inode_unlock_tracker(struct inode *inode,
Signature · 1 line
2.30.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

The case where "tmp_oh" is NULL is handled at the start of the function. At this point we know it's non-NULL so this will always return 1.

Quoted 18 lines
---
 fs/ocfs2/dlmglue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ocfs2/dlmglue.c +1 -1
index 48fd369c29a4..33fbdc823278 100644
@@ -2721,7 +2721,7 @@ int ocfs2_inode_lock_tracker(struct inode *inode,
 			return status;
 		}
 	}
-	return tmp_oh ? 1 : 0;
+	return 1;
 }
 
 void ocfs2_inode_unlock_tracker(struct inode *inode,