Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libceph: remove unnecessary ret variable in ceph_auth_init()

There is no necessary to define variable assignment, just return
directly to simplify the steps.

Signed-off-by: zuoqilin <zuoqilin@yulong.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by

zuoqilin and committed by
Ilya Dryomov
da6ebb4d 1e6de263

+1 -6
+1 -6
net/ceph/auth.c
··· 58 58 const int *con_modes) 59 59 { 60 60 struct ceph_auth_client *ac; 61 - int ret; 62 61 63 - ret = -ENOMEM; 64 62 ac = kzalloc(sizeof(*ac), GFP_NOFS); 65 63 if (!ac) 66 - goto out; 64 + return ERR_PTR(-ENOMEM); 67 65 68 66 mutex_init(&ac->mutex); 69 67 ac->negotiating = true; ··· 76 78 dout("%s name '%s' preferred_mode %d fallback_mode %d\n", __func__, 77 79 ac->name, ac->preferred_mode, ac->fallback_mode); 78 80 return ac; 79 - 80 - out: 81 - return ERR_PTR(ret); 82 81 } 83 82 84 83 void ceph_auth_destroy(struct ceph_auth_client *ac)