diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2019-10-09 21:08:24 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-11 20:45:31 -0700 |
commit | 28e72b26ddeeef474ee9a8dd15df61b35ff557d8 (patch) | |
tree | 9341904aecba6c5b2a5561fa79e50230f792c0bb /net/core/sock.c | |
parent | 262ce0af81616b4be520ea7050ec1e31b80b5ab1 (diff) | |
download | linux-28e72b26ddeeef474ee9a8dd15df61b35ff557d8.tar.gz linux-28e72b26ddeeef474ee9a8dd15df61b35ff557d8.tar.bz2 linux-28e72b26ddeeef474ee9a8dd15df61b35ff557d8.zip |
sock_get_timeout: drop unnecessary return variable
Remove pointless use of size return variable by directly returning
sizes.
Signed-off-by: Vito Caputo <vcaputo@pengaru.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 24e93407239a..ceda6b126d84 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -333,7 +333,6 @@ EXPORT_SYMBOL(__sk_backlog_rcv); static int sock_get_timeout(long timeo, void *optval, bool old_timeval) { struct __kernel_sock_timeval tv; - int size; if (timeo == MAX_SCHEDULE_TIMEOUT) { tv.tv_sec = 0; @@ -354,13 +353,11 @@ static int sock_get_timeout(long timeo, void *optval, bool old_timeval) old_tv.tv_sec = tv.tv_sec; old_tv.tv_usec = tv.tv_usec; *(struct __kernel_old_timeval *)optval = old_tv; - size = sizeof(old_tv); - } else { - *(struct __kernel_sock_timeval *)optval = tv; - size = sizeof(tv); + return sizeof(old_tv); } - return size; + *(struct __kernel_sock_timeval *)optval = tv; + return sizeof(tv); } static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen, bool old_timeval) |