![]() |
lvs-devel
|
| To: | Julia.Lawall@xxxxxxxx, Simon Horman <horms@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>, Florian Westphal <fw@xxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Eric Dumazet <edumazet@xxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Paolo Abeni <pabeni@xxxxxxxxxx> |
|---|---|
| Subject: | [PATCH 11/36] ipvs: remove conditional return with no effect |
| Cc: | cocci@xxxxxxxx, coreteam@xxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Phil Sutter <phil@xxxxxx>, Simon Horman <horms@xxxxxxxxxx> |
| From: | Sang-Heon Jeon <ekffu200098@xxxxxxxxx> |
| Date: | Fri, 24 Jul 2026 03:45:13 +0900 |
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.
Signed-off-by: Sang-Heon Jeon <ekffu200098@xxxxxxxxx>
---
net/netfilter/ipvs/ip_vs_sync.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 93038abbf5e0..bd4f7e906cf7 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1603,15 +1603,10 @@ ip_vs_receive(struct socket *sock, char *buffer, const
size_t buflen)
{
struct msghdr msg = {NULL,};
struct kvec iov = {buffer, buflen};
- int len;
/* Receive a packet */
iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, buflen);
- len = sock_recvmsg(sock, &msg, MSG_DONTWAIT);
- if (len < 0)
- return len;
-
- return len;
+ return sock_recvmsg(sock, &msg, MSG_DONTWAIT);
}
/* Wakeup the master thread for sending */
--
2.43.0
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 00/36] treewide: remove conditional returns with no effect, Sang-Heon Jeon |
|---|---|
| Next by Date: | Re: [PATCH 00/36] treewide: remove conditional returns with no effect, Jakub Kicinski |
| Previous by Thread: | [PATCH 00/36] treewide: remove conditional returns with no effect, Sang-Heon Jeon |
| Next by Thread: | Re: [PATCH 00/36] treewide: remove conditional returns with no effect, Jakub Kicinski |
| Indexes: | [Date] [Thread] [Top] [All Lists] |