All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li kunyu <kunyu@nfschina.com>
To: idryomov@gmail.com, xiubli@redhat.com, jlayton@kernel.org,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com
Cc: ceph-devel@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Li kunyu <kunyu@nfschina.com>
Subject: [PATCH] ceph/decode: Remove unnecessary ‘0’ values from ret
Date: Sun,  3 Sep 2023 04:11:12 +0800	[thread overview]
Message-ID: <20230902201112.4401-1-kunyu@nfschina.com> (raw)

ret is assigned first, so it does not need to initialize the
assignment.
Bad is not used and can be removed.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
 net/ceph/decode.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/ceph/decode.c b/net/ceph/decode.c
index bc109a1a4616..9f5f095d8235 100644
--- a/net/ceph/decode.c
+++ b/net/ceph/decode.c
@@ -50,7 +50,7 @@ static int
 ceph_decode_entity_addr_legacy(void **p, void *end,
 			       struct ceph_entity_addr *addr)
 {
-	int ret = -EINVAL;
+	int ret = 0;
 
 	/* Skip rest of type field */
 	ceph_decode_skip_n(p, end, 3, bad);
@@ -66,8 +66,7 @@ ceph_decode_entity_addr_legacy(void **p, void *end,
 			      sizeof(addr->in_addr), bad);
 	addr->in_addr.ss_family =
 			be16_to_cpu((__force __be16)addr->in_addr.ss_family);
-	ret = 0;
-bad:
+
 	return ret;
 }
 
-- 
2.18.2


             reply	other threads:[~2023-09-01  3:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-02 20:11 Li kunyu [this message]
2023-09-01  4:08 ` [PATCH] ceph/decode: Remove unnecessary ‘0’ values from ret Xiubo Li
2023-09-01 13:55 ` Simon Horman
     [not found] <20230902201112.4401-1-kunyu__5722.10796396888$1693539625$gmane$org@nfschina.com>
2023-09-01  4:59 ` Christophe JAILLET

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=20230902201112.4401-1-kunyu@nfschina.com \
    --to=kunyu@nfschina.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xiubli@redhat.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.