All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Dryomov <idryomov@gmail.com>
To: zuoqilin1@163.com
Cc: Jeff Layton <jlayton@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Ceph Development <ceph-devel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	zuoqilin <zuoqilin@yulong.com>
Subject: Re: [PATCH] net/ceph: Remove unnecessary variables
Date: Mon, 14 Jun 2021 19:17:03 +0200	[thread overview]
Message-ID: <CAOi1vP89H+D_FDoFEjzqC1ff7ryjBhAYEwtH6NC8YhmXWpyQhQ@mail.gmail.com> (raw)
In-Reply-To: <20210610094505.1341-1-zuoqilin1@163.com>

On Thu, Jun 10, 2021 at 12:02 PM <zuoqilin1@163.com> wrote:
>
> 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)

Applied.

Thanks,

                Ilya

      reply	other threads:[~2021-06-14 17:18 UTC|newest]

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

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=CAOi1vP89H+D_FDoFEjzqC1ff7ryjBhAYEwtH6NC8YhmXWpyQhQ@mail.gmail.com \
    --to=idryomov@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=jlayton@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=zuoqilin1@163.com \
    --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.