Skip to content

Commit

Permalink
sock_get_timeout: drop unnecessary return variable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vito Caputo authored and David S. Miller committed Oct 12, 2019
1 parent 262ce0a commit 28e72b2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit 28e72b2

Please sign in to comment.