libceph: drop ->monmap and err initialization
authorJean Sacren <sakiwit@gmail.com>
Mon, 11 Oct 2021 06:45:24 +0000 (00:45 -0600)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 8 Nov 2021 02:29:51 +0000 (03:29 +0100)
Call to build_initial_monmap() is one stone two birds.  Explicitly it
initializes err variable. Implicitly it initializes ->monmap via call to
kzalloc().  We should only declare err and ->monmap is taken care of by
ceph_monc_init() prototype.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/mon_client.c

index 013cbdb6cfe26bcad05d5b104d85b53063b98503..6a6898ee40495d9de053396ae29cf482c0a62c66 100644 (file)
@@ -1153,12 +1153,11 @@ static int build_initial_monmap(struct ceph_mon_client *monc)
 
 int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl)
 {
-       int err = 0;
+       int err;
 
        dout("init\n");
        memset(monc, 0, sizeof(*monc));
        monc->client = cl;
-       monc->monmap = NULL;
        mutex_init(&monc->mutex);
 
        err = build_initial_monmap(monc);