ceph/decode: Remove unnecessary ‘0’ values from ret
Subsystems (3)
PATCH 1/1 ceph/decode: Remove unnecessary ‘0’ values from ret
ret is assigned first, so it does not need to initialize the assignment.
Bad is not used and can be removed.
--- net/ceph/decode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
net/ceph/decode.c +2 -3
@@ -50,7 +50,7 @@ static intceph_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; }
Signature · 1 line
2.18.2
Quoted 14 lines · 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 <[email protected]>--- net/ceph/decode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)net/ceph/decode.c +0
-0
net/ceph/decode.c static int · line 56
Quoted 8 lines
net/ceph/decode.c +1
-1@@ -50,7 +50,7 @@ static intceph_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
Quoted 10 lines
net/ceph/decode.c +1
-2@@ -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; }
Simon Horman
reviewerQuoted 5 lines · 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 <[email protected]>
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