Skip to contentSkip to conversation

hpfs: remove redundant variable r

PATCH New Colin Ian King 1 participant 1 message Jun 21, 2023

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

PATCH 1/1 hpfs: remove redundant variable r

Variable r is being assigned a value that is not being read, the assignment and the variable are redundant and can be removed. It is also useful to remove r as it's a confusing shadow of another variable r declared in a higher scope. Cleans up clang scan build warning:

fs/hpfs/namei.c:560:8: warning: Although the value stored to 'r' is used in the enclosing expression, the value is never actually read from 'r' [deadcode.DeadStores]

---
 fs/hpfs/namei.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/hpfs/namei.c +1 -2
index 69fb40b2c99a..d892a6f74431 100644
@@ -556,8 +556,7 @@ static int hpfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
 	de.hidden = new_name[0] == '.';
 
 	if (new_inode) {
-		int r;
-		if ((r = hpfs_remove_dirent(old_dir, dno, dep, &qbh, 1)) != 2) {
+		if (hpfs_remove_dirent(old_dir, dno, dep, &qbh, 1) != 2) {
 			if ((nde = map_dirent(new_dir, hpfs_i(new_dir)->i_dno, new_name, new_len, NULL, &qbh1))) {
 				clear_nlink(new_inode);
 				copy_de(nde, &de);
Signature · 1 line
2.39.2