libceph: drop ->monmap and err initialization

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>
This commit is contained in:
Jean Sacren 2021-10-11 00:45:24 -06:00 committed by Ilya Dryomov
parent 9c43ff4490
commit a341131eb3

View 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 ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl)
{ {
int err = 0; int err;
dout("init\n"); dout("init\n");
memset(monc, 0, sizeof(*monc)); memset(monc, 0, sizeof(*monc));
monc->client = cl; monc->client = cl;
monc->monmap = NULL;
mutex_init(&monc->mutex); mutex_init(&monc->mutex);
err = build_initial_monmap(monc); err = build_initial_monmap(monc);