Skip to contentSkip to conversation

ceph: remove redundant variable ino

PATCH In review Colin Ian King 3 participants 3 messages May 18, 2022

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

PATCH 1/1 ceph: remove redundant variable ino

Variable ino is being assigned a value that is never read. The variable and assignment are redundant, remove it.

Cleans up clang scan build warning:
warning: Although the value stored to 'ino' is used in the enclosing expression, the value is never actually read from 'ino' [deadcode.DeadStores]

---
 fs/ceph/mds_client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ceph/mds_client.c +2 -2
index 00c3de177dd6..20197f05faec 100644
@@ -437,7 +437,7 @@ static int ceph_parse_deleg_inos(void **p, void *end,
 	ceph_decode_32_safe(p, end, sets, bad);
 	dout("got %u sets of delegated inodes\n", sets);
 	while (sets--) {
-		u64 start, len, ino;
+		u64 start, len;
 
 		ceph_decode_64_safe(p, end, start, bad);
 		ceph_decode_64_safe(p, end, len, bad);
@@ -449,7 +449,7 @@ static int ceph_parse_deleg_inos(void **p, void *end,
 			continue;
 		}
 		while (len--) {
-			int err = xa_insert(&s->s_delegated_inos, ino = start++,
+			int err = xa_insert(&s->s_delegated_inos, start++,
 					    DELEGATED_INO_AVAILABLE,
 					    GFP_KERNEL);
 			if (!err) {
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Colin Ian King

Variable ino is being assigned a value that is never read. The variable and assignment are redundant, remove it.

Cleans up clang scan build warning:
warning: Although the value stored to 'ino' is used in the enclosing expression, the value is never actually read from 'ino' [deadcode.DeadStores]

---
 fs/ceph/mds_client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ceph/mds_client.c +1 -1
index 00c3de177dd6..20197f05faec 100644
@@ -437,7 +437,7 @@ static int ceph_parse_deleg_inos(void **p, void *end,
 	ceph_decode_32_safe(p, end, sets, bad);
 	dout("got %u sets of delegated inodes\n", sets);
 	while (sets--) {
-		u64 start, len, ino;
+		u64 start, len;
 
 		ceph_decode_64_safe(p, end, start, bad);
 		ceph_decode_64_safe(p, end, len, bad);

fs/ceph/mds_client.c static int ceph_parse_deleg_inos(void **p, void *end, · line 455

Quoted 8 lines
fs/ceph/mds_client.c +1 -1
@@ -449,7 +449,7 @@ static int ceph_parse_deleg_inos(void **p, void *end,
 			continue;
 		}
 		while (len--) {
-			int err = xa_insert(&s->s_delegated_inos, ino = start++,
+			int err = xa_insert(&s->s_delegated_inos, start++,
 					    DELEGATED_INO_AVAILABLE,
 					    GFP_KERNEL);
 			if (!err) {
#2 lore raw
In reply to Colin Ian King
Quoted 27 lines · Colin Ian King

Variable ino is being assigned a value that is never read. The variable and assignment are redundant, remove it.

Cleans up clang scan build warning:
warning: Although the value stored to 'ino' is used in the enclosing expression, the value is never actually read from 'ino' [deadcode.DeadStores]

---
  fs/ceph/mds_client.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
fs/ceph/mds_client.c +1 -1
index 00c3de177dd6..20197f05faec 100644
@@ -437,7 +437,7 @@ static int ceph_parse_deleg_inos(void **p, void *end,
  	ceph_decode_32_safe(p, end, sets, bad);
  	dout("got %u sets of delegated inodes\n", sets);
  	while (sets--) {
-		u64 start, len, ino;
+		u64 start, len;
 
  		ceph_decode_64_safe(p, end, start, bad);
  		ceph_decode_64_safe(p, end, len, bad);

fs/ceph/mds_client.c static int ceph_parse_deleg_inos(void **p, void *end, · line 455

Quoted 8 lines
fs/ceph/mds_client.c +1 -1
@@ -449,7 +449,7 @@ static int ceph_parse_deleg_inos(void **p, void *end,
  			continue;
  		}
  		while (len--) {
-			int err = xa_insert(&s->s_delegated_inos, ino = start++,
+			int err = xa_insert(&s->s_delegated_inos, start++,
  					    DELEGATED_INO_AVAILABLE,
  					    GFP_KERNEL);
  			if (!err) {

Merged into ceph-client/testing branch. Thanks!

-- Xiubo