Skip to contentSkip to conversation

jfs: remove redundant initialization to pointer ip

PATCH In review Colin Ian King 2 participants 2 messages Aug 18, 2023 – Aug 29, 2023

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

PATCH v2 1/1 jfs: remove redundant initialization to pointer ip

The pointer ip is being initialized with a value that is never read, it is being re-assigned later on. The assignment is redundant and can be removed. Cleans up clang scan warning:

fs/jfs/namei.c:886:16: warning: Value stored to 'ip' during its initialization is never read [deadcode.DeadStores]

---

V2: fix commit message "uninitialized" -> "initialized"

---
 fs/jfs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jfs/namei.c +1 -1
index 029d47065600..57d7a4300210 100644
@@ -883,7 +883,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip,
 	struct component_name dname;
 	u32 ssize;		/* source pathname size */
 	struct btstack btstack;
-	struct inode *ip = d_inode(dentry);
+	struct inode *ip;
 	s64 xlen = 0;
 	int bmask = 0, xsize;
 	s64 xaddr;
Signature · 1 line
2.39.2
#1 lore raw
Quoted 6 lines · Colin Ian King

The pointer ip is being initialized with a value that is never read, it is being re-assigned later on. The assignment is redundant and can be removed. Cleans up clang scan warning:

fs/jfs/namei.c:886:16: warning: Value stored to 'ip' during its initialization is never read [deadcode.DeadStores]

Looks good. Applied.

Quoted 23 lines

---

V2: fix commit message "uninitialized" -> "initialized"

---
  fs/jfs/namei.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/jfs/namei.c +1 -1
index 029d47065600..57d7a4300210 100644
@@ -883,7 +883,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip,
  	struct component_name dname;
  	u32 ssize;		/* source pathname size */
  	struct btstack btstack;
-	struct inode *ip = d_inode(dentry);
+	struct inode *ip;
  	s64 xlen = 0;
  	int bmask = 0, xsize;
  	s64 xaddr;