mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
net: Remove the err argument from sock_from_file
Currently, the sock_from_file prototype takes an "err" pointer that is either not set or set to -ENOTSOCK IFF the returned socket is NULL. This makes the error redundant and it is ignored by a few callers. This patch simplifies the API by letting callers deduce the error based on whether the returned socket is NULL or not. Suggested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Florent Revest <revest@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: KP Singh <kpsingh@google.com> Link: https://lore.kernel.org/bpf/20201204113609.1850150-1-revest@google.com
This commit is contained in:
committed by
Daniel Borkmann
parent
5c667dca71
commit
dba4a9256b
@@ -416,12 +416,11 @@ static inline void ep_set_busy_poll_napi_id(struct epitem *epi)
|
||||
unsigned int napi_id;
|
||||
struct socket *sock;
|
||||
struct sock *sk;
|
||||
int err;
|
||||
|
||||
if (!net_busy_loop_on())
|
||||
return;
|
||||
|
||||
sock = sock_from_file(epi->ffd.file, &err);
|
||||
sock = sock_from_file(epi->ffd.file);
|
||||
if (!sock)
|
||||
return;
|
||||
|
||||
|
Reference in New Issue
Block a user