All of lore.kernel.org
 help / color / mirror / Atom feed
From: zuoqilin1@163.com
To: idryomov@gmail.com, jlayton@kernel.org, davem@davemloft.net,
	kuba@kernel.org
Cc: ceph-devel@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, zuoqilin <zuoqilin@yulong.com>
Subject: [PATCH] net/ceph: Remove unnecessary variables
Date: Thu, 10 Jun 2021 17:45:05 +0800	[thread overview]
Message-ID: <20210610094505.1341-1-zuoqilin1@163.com> (raw)

From: zuoqilin <zuoqilin@yulong.com>

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

Signed-off-by: zuoqilin <zuoqilin@yulong.com>
---
 net/ceph/auth.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/net/ceph/auth.c b/net/ceph/auth.c
index de407e8..b824a48 100644
--- a/net/ceph/auth.c
+++ b/net/ceph/auth.c
@@ -58,12 +58,10 @@ struct ceph_auth_client *ceph_auth_init(const char *name,
 					const int *con_modes)
 {
 	struct ceph_auth_client *ac;
-	int ret;
 
-	ret = -ENOMEM;
 	ac = kzalloc(sizeof(*ac), GFP_NOFS);
 	if (!ac)
-		goto out;
+		return ERR_PTR(-ENOMEM);
 
 	mutex_init(&ac->mutex);
 	ac->negotiating = true;
@@ -78,9 +76,6 @@ struct ceph_auth_client *ceph_auth_init(const char *name,
 	dout("%s name '%s' preferred_mode %d fallback_mode %d\n", __func__,
 	     ac->name, ac->preferred_mode, ac->fallback_mode);
 	return ac;
-
-out:
-	return ERR_PTR(ret);
 }
 
 void ceph_auth_destroy(struct ceph_auth_client *ac)
-- 
1.9.1



             reply	other threads:[~2021-06-10 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  9:45 zuoqilin1 [this message]
2021-06-14 17:17 ` [PATCH] net/ceph: Remove unnecessary variables Ilya Dryomov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210610094505.1341-1-zuoqilin1@163.com \
    --to=zuoqilin1@163.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=zuoqilin@yulong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.