* Re: [PATCH] ceph/decode: Remove unnecessary ‘0’ values from ret
2023-09-02 20:11 [PATCH] ceph/decode: Remove unnecessary ‘0’ values from ret Li kunyu
@ 2023-09-01 4:08 ` Xiubo Li
2023-09-01 13:55 ` Simon Horman
1 sibling, 0 replies; 4+ messages in thread
From: Xiubo Li @ 2023-09-01 4:08 UTC (permalink / raw)
To: Li kunyu, idryomov, jlayton, davem, edumazet, kuba, pabeni
Cc: ceph-devel, netdev, linux-kernel
On 9/3/23 04:11, Li kunyu wrote:
> 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);
Hi Kunyu,
The 'bad' lable is used here in this macro.
Thanks
- Xiubo
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ceph/decode: Remove unnecessary ‘0’ values from ret
[not found] <20230902201112.4401-1-kunyu__5722.10796396888$1693539625$gmane$org@nfschina.com>
@ 2023-09-01 4:59 ` Christophe JAILLET
0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2023-09-01 4:59 UTC (permalink / raw)
To: Li kunyu, idryomov, xiubli, jlayton, davem, edumazet, kuba,
pabeni
Cc: ceph-devel, netdev, linux-kernel
Le 01/09/2023 à 05:40, Li kunyu a écrit :
> 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;
> }
>
This patch is wrong.
Look how the ceph_decode_skip_n() macro, for example, is expended.
You'll see that 'bad' is needed.
I think that your patch was not compile tested.
Please do not send patch that are not at least compile tested. Even when
it looks obvious.
CJ
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ceph/decode: Remove unnecessary ‘0’ values from ret
2023-09-02 20:11 [PATCH] ceph/decode: Remove unnecessary ‘0’ values from ret Li kunyu
2023-09-01 4:08 ` Xiubo Li
@ 2023-09-01 13:55 ` Simon Horman
1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-09-01 13:55 UTC (permalink / raw)
To: Li kunyu
Cc: idryomov, xiubli, jlayton, davem, edumazet, kuba, pabeni,
ceph-devel, netdev, linux-kernel
On Sun, Sep 03, 2023 at 04:11:12AM +0800, Li kunyu wrote:
> 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>
Hi Li Kunyu,
A few things:
* Your clock seems to be in the future.
* I see you have posted similar similar changes to related code.
Please consider combining them into a single patch,
or a patch-set.
* Please set the target tree, net-next
Subject: [PATCH net-next] ...
* net-next is currently closed
## Form letter - net-next-closed
The merge window for v6.6 has begun and therefore net-next is closed
for new drivers, features, code refactoring and optimizations.
We are currently accepting bug fixes only.
Please repost when net-next reopens after Sept 11th.
RFC patches sent for review only are obviously welcome at any time.
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
--
pw-bot: defer
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ceph/decode: Remove unnecessary ‘0’ values from ret
@ 2023-09-02 20:11 Li kunyu
2023-09-01 4:08 ` Xiubo Li
2023-09-01 13:55 ` Simon Horman
0 siblings, 2 replies; 4+ messages in thread
From: Li kunyu @ 2023-09-02 20:11 UTC (permalink / raw)
To: idryomov, xiubli, jlayton, davem, edumazet, kuba, pabeni
Cc: ceph-devel, netdev, linux-kernel, Li kunyu
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-01 13:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-02 20:11 [PATCH] ceph/decode: Remove unnecessary ‘0’ values from ret Li kunyu
2023-09-01 4:08 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).