Skip to content

Commit c49661a

Browse files
Cong Wangborkmann
authored andcommitted
skmsg: Remove unused parameters of sk_msg_wait_data()
'err' and 'flags' are not used, we can just get rid of them. Signed-off-by: Cong Wang <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Song Liu <[email protected]> Acked-by: John Fastabend <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 119220d commit c49661a

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

include/linux/skmsg.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ int sk_msg_zerocopy_from_iter(struct sock *sk, struct iov_iter *from,
126126
struct sk_msg *msg, u32 bytes);
127127
int sk_msg_memcopy_from_iter(struct sock *sk, struct iov_iter *from,
128128
struct sk_msg *msg, u32 bytes);
129-
int sk_msg_wait_data(struct sock *sk, struct sk_psock *psock, int flags,
130-
long timeo, int *err);
129+
int sk_msg_wait_data(struct sock *sk, struct sk_psock *psock, long timeo);
131130
int sk_msg_recvmsg(struct sock *sk, struct sk_psock *psock, struct msghdr *msg,
132131
int len, int flags);
133132

net/core/skmsg.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,7 @@ int sk_msg_memcopy_from_iter(struct sock *sk, struct iov_iter *from,
399399
}
400400
EXPORT_SYMBOL_GPL(sk_msg_memcopy_from_iter);
401401

402-
int sk_msg_wait_data(struct sock *sk, struct sk_psock *psock, int flags,
403-
long timeo, int *err)
402+
int sk_msg_wait_data(struct sock *sk, struct sk_psock *psock, long timeo)
404403
{
405404
DEFINE_WAIT_FUNC(wait, woken_wake_function);
406405
int ret = 0;

net/ipv4/tcp_bpf.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,26 +184,21 @@ static int tcp_bpf_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
184184
msg_bytes_ready:
185185
copied = sk_msg_recvmsg(sk, psock, msg, len, flags);
186186
if (!copied) {
187-
int data, err = 0;
188187
long timeo;
188+
int data;
189189

190190
timeo = sock_rcvtimeo(sk, nonblock);
191-
data = sk_msg_wait_data(sk, psock, flags, timeo, &err);
191+
data = sk_msg_wait_data(sk, psock, timeo);
192192
if (data) {
193193
if (!sk_psock_queue_empty(psock))
194194
goto msg_bytes_ready;
195195
release_sock(sk);
196196
sk_psock_put(sk, psock);
197197
return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len);
198198
}
199-
if (err) {
200-
ret = err;
201-
goto out;
202-
}
203199
copied = -EAGAIN;
204200
}
205201
ret = copied;
206-
out:
207202
release_sock(sk);
208203
sk_psock_put(sk, psock);
209204
return ret;

net/ipv4/udp_bpf.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,17 @@ static int udp_bpf_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
4343
msg_bytes_ready:
4444
copied = sk_msg_recvmsg(sk, psock, msg, len, flags);
4545
if (!copied) {
46-
int data, err = 0;
4746
long timeo;
47+
int data;
4848

4949
timeo = sock_rcvtimeo(sk, nonblock);
50-
data = sk_msg_wait_data(sk, psock, flags, timeo, &err);
50+
data = sk_msg_wait_data(sk, psock, timeo);
5151
if (data) {
5252
if (!sk_psock_queue_empty(psock))
5353
goto msg_bytes_ready;
5454
ret = sk_udp_recvmsg(sk, msg, len, nonblock, flags, addr_len);
5555
goto out;
5656
}
57-
if (err) {
58-
ret = err;
59-
goto out;
60-
}
6157
copied = -EAGAIN;
6258
}
6359
ret = copied;

0 commit comments

Comments
 (0)