diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-06-25 12:17:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-25 19:33:05 -0400 |
commit | 62208f12451f723cd9e9f1d6d22866a61545e488 (patch) | |
tree | 95554c56a68e4d64ba431d0e0099adcb461bf76b /net/sctp/socket.c | |
parent | 0a2fbac197441ebeafbbef09d4bbc0b5e73716d7 (diff) |
net: sctp: simplify sctp_get_port
No need to have an extra ret variable when we directly can return
the value of sctp_get_port_local().
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index ba9359c20c8a..66fcdcfe1b74 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -6036,7 +6036,6 @@ fail: | |||
6036 | */ | 6036 | */ |
6037 | static int sctp_get_port(struct sock *sk, unsigned short snum) | 6037 | static int sctp_get_port(struct sock *sk, unsigned short snum) |
6038 | { | 6038 | { |
6039 | long ret; | ||
6040 | union sctp_addr addr; | 6039 | union sctp_addr addr; |
6041 | struct sctp_af *af = sctp_sk(sk)->pf->af; | 6040 | struct sctp_af *af = sctp_sk(sk)->pf->af; |
6042 | 6041 | ||
@@ -6045,9 +6044,7 @@ static int sctp_get_port(struct sock *sk, unsigned short snum) | |||
6045 | addr.v4.sin_port = htons(snum); | 6044 | addr.v4.sin_port = htons(snum); |
6046 | 6045 | ||
6047 | /* Note: sk->sk_num gets filled in if ephemeral port request. */ | 6046 | /* Note: sk->sk_num gets filled in if ephemeral port request. */ |
6048 | ret = sctp_get_port_local(sk, &addr); | 6047 | return !!sctp_get_port_local(sk, &addr); |
6049 | |||
6050 | return ret ? 1 : 0; | ||
6051 | } | 6048 | } |
6052 | 6049 | ||
6053 | /* | 6050 | /* |