Skip to contentSkip to conversation

ceph: remove redundant initialization of variable mds

PATCH In review Colin King 2 participants 2 messages Jul 23, 2020

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 ceph: remove redundant initialization of variable mds

From: Colin Ian King <[email protected]>

The variable mds is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 fs/ceph/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/debugfs.c +1 -1
index 070ed8481340..48f5afb56c91 100644
@@ -272,7 +272,7 @@ static int mds_sessions_show(struct seq_file *s, void *ptr)
 	struct ceph_mds_client *mdsc = fsc->mdsc;
 	struct ceph_auth_client *ac = fsc->client->monc.auth;
 	struct ceph_options *opt = fsc->client->options;
-	int mds = -1;
+	int mds;
 
 	mutex_lock(&mdsc->mutex);
 
Signature · 1 line
2.27.0
#1 lore raw
Quoted 17 lines · Colin King

From: Colin Ian King <[email protected]>

The variable mds is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 fs/ceph/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/debugfs.c +0 -0
index 070ed8481340..48f5afb56c91 100644

fs/ceph/debugfs.c static int mds_sessions_show(struct seq_file *s, void *ptr) · line 278

Quoted 8 lines
fs/ceph/debugfs.c +1 -1
@@ -272,7 +272,7 @@ static int mds_sessions_show(struct seq_file *s, void *ptr)
 	struct ceph_mds_client *mdsc = fsc->mdsc;
 	struct ceph_auth_client *ac = fsc->client->monc.auth;
 	struct ceph_options *opt = fsc->client->options;
-	int mds = -1;
+	int mds;
 
 	mutex_lock(&mdsc->mutex);
 

Thanks, merged into testing branch.

Signature · 1 line
Jeff Layton <[email protected]>