summaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-06-25 18:17:30 +0200
committerDavid S. Miller <davem@davemloft.net>2013-06-25 16:33:05 -0700
commit62208f12451f723cd9e9f1d6d22866a61545e488 (patch)
tree95554c56a68e4d64ba431d0e0099adcb461bf76b /net/sctp
parent0a2fbac197441ebeafbbef09d4bbc0b5e73716d7 (diff)
downloadlinux-62208f12451f723cd9e9f1d6d22866a61545e488.tar.gz
linux-62208f12451f723cd9e9f1d6d22866a61545e488.tar.bz2
linux-62208f12451f723cd9e9f1d6d22866a61545e488.zip
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')
-rw-r--r--net/sctp/socket.c5
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:
*/
static int sctp_get_port(struct sock *sk, unsigned short snum)
{
- long ret;
union sctp_addr addr;
struct sctp_af *af = sctp_sk(sk)->pf->af;
@@ -6045,9 +6044,7 @@ static int sctp_get_port(struct sock *sk, unsigned short snum)
addr.v4.sin_port = htons(snum);
/* Note: sk->sk_num gets filled in if ephemeral port request. */
- ret = sctp_get_port_local(sk, &addr);
-
- return ret ? 1 : 0;
+ return !!sctp_get_port_local(sk, &addr);
}
/*