[PATCH 11/36] ipvs: remove conditional return with no effect
From: Sang-Heon Jeon
Date: Thu Jul 23 2026 - 14:55:32 EST
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